-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathwebpack.config.js
41 lines (39 loc) · 1.29 KB
/
webpack.config.js
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
const path = require('path') ;
const HtmlWebpackPlugin = require('html-webpack-plugin') ;
const HtmlWebpackPluginConfig = new HtmlWebpackPlugin({
template: './web/index.html',
filename: 'index.html',
inject: 'body'
})
module.exports = {
entry: ['babel-polyfill', './web/index.jsx'],
output: {
path: path.resolve(__dirname, 'nord', 'web', 'static'),
filename: 'index_bundle.js',
},
plugins: [HtmlWebpackPluginConfig],
module: {
loaders: [
{
test: /\.(jsx|js)$/,
exclude: /node_modules/,
loader: 'babel-loader',
query: {
plugins: ['transform-runtime'],
presets: ['es2015', 'react', 'stage-3']
}
},
{ test: /\.css$/,use: ['style-loader', 'css-loader'] },
{ test: /\.(png|jpg|gif)$/, loader: "file-loader" },
{ test: /\.(woff(2)?|ttf|eot|svg|otf)(\?v=\d+\.\d+\.\d+)?$/, loader: "file-loader" },
{ test: /LICENSE/, loader: 'file-loader', options: { name: '[name]'} },
{
test: /\.geo\.json/,
loader: 'file-loader',
options: {
name: '[name].[ext]'
}
},
]
}
} ;