-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
33 lines (32 loc) · 974 Bytes
/
webpack.config.js
File metadata and controls
33 lines (32 loc) · 974 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
const path = require('path');
const webpack = require('webpack');
module.exports = {
entry: ['babel-polyfill', './src/index.js'],
output: { path: path.resolve('./app'), filename: 'bundle.js' },
module: {
rules: [{
test: /\.jsx?$/, loader: 'babel-loader',
options: {
presets: [
['env', { targets: { browsers: ['last 2 versions', '> 5% in KR'] }, modules: false }], // 브라우저일 경우만
['stage-2']
],
},
exclude: ['/node_modules'],
}],
},
plugins: [
new webpack.LoaderOptionsPlugin({ minimize: true }),
new webpack.optimize.ModuleConcatenationPlugin(),
new webpack.optimize.UglifyJsPlugin({ sourceMap: true, compress: { warnings: false, drop_console: true }, output: { comments: false } }),
],
resolve: {
modules: ['node_modules'],
extensions: ['.js', '.json', '.jsx', '.css'],
},
watch: true,
watchOptions: {
aggregateTimeout: 300,
poll: 1000
}
};