Line 0
Link Here
|
|
|
1 |
var webpack = require('webpack'); |
2 |
|
3 |
module.exports = { |
4 |
entry: { |
5 |
moredetail: './koha-tmpl/intranet-tmpl/prog/js/public/moredetail.js', |
6 |
}, |
7 |
output: { |
8 |
path: './koha-tmpl/intranet-tmpl/prog/js/app', |
9 |
filename: '[name].js' // Template based on keys in entry above |
10 |
}, |
11 |
module: { |
12 |
loaders: [ |
13 |
{ |
14 |
test: /\.js$/, |
15 |
loader: 'babel-loader', |
16 |
query: { |
17 |
presets: ['react'] |
18 |
} |
19 |
} |
20 |
] |
21 |
}, |
22 |
resolve: { |
23 |
// you can now require('file') instead of require('file.js') |
24 |
extensions: ['', '.js', '.json'] |
25 |
}, |
26 |
plugins: [ |
27 |
new webpack.DefinePlugin({ |
28 |
'process.env':{ |
29 |
'NODE_ENV': JSON.stringify('production') |
30 |
} |
31 |
}), |
32 |
new webpack.optimize.UglifyJsPlugin({ |
33 |
compress:{ |
34 |
warnings: true |
35 |
} |
36 |
}) |
37 |
] |
38 |
}; |