Repository navigation
Expand file tree
/
Copy pathwebpack.common.js
More file actions
52 lines (50 loc) · 1.59 KB
/
Copy pathwebpack.common.js
File metadata and controls
52 lines (50 loc) · 1.59 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
const path = require('path');
const HtmlWebpackPathAssetsFix = require('html-webpack-plugin-assets-fix');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
entry: './client/index.js',
output: {
path: path.resolve('build'),
filename: '[name].bundle.js',
publicPath: '/'
},
module: {
loaders: [
{ test: /\.json$/, loader: 'json-loader', exclude: /node_modules/ },
{
test: /\.css$/, loader: [ 'style-loader', 'css-loader' ]
},
{ test: /\.js$/, loader: 'babel-loader', exclude: /node_modules/,
query: {
presets: ['react', 'es2015', 'stage-2'],
plugins: ['transform-react-jsx','transform-es2015-modules-commonjs','syntax-dynamic-import','transform-object-rest-spread','transform-regenerator','transform-runtime'],
},
},
{ test: /\.jsx$/, loader: 'babel-loader', exclude: /node_modules/,
query: {
presets: ['react', 'es2015', 'stage-2'],
plugins: ['transform-react-jsx','transform-es2015-modules-commonjs','syntax-dynamic-import','transform-object-rest-spread','transform-regenerator','transform-runtime'],
},
}
]
},
resolve: {
extensions: ['.js', '.jsx', '.css', '.json'],
},
devServer: {
historyApiFallback: true,
},
plugins: [
new HtmlWebpackPlugin({
template: './client/index.html',
filename: 'index.html',
inject: 'body'
})/*,
new HtmlWebpackPlugin({
template: './client/statics/css/ace.css',
filename: 'statics/css/ace.css',
chunks: ['statics'],
fixAssets: true
})*/
]
}