-
Notifications
You must be signed in to change notification settings - Fork 3
/
webpack.config.base.js
51 lines (50 loc) · 1.3 KB
/
webpack.config.base.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
42
43
44
45
46
47
48
49
50
51
import path from 'path';
import webpack from 'webpack';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import ExtractTextPlugin from 'extract-text-webpack-plugin';
export default {
module : {
rules: [
{
test: /\.js$/,
use: 'babel-loader',
exclude: /node_modules/
}, {
test: /\.json$/,
use: 'json-loader'
},
{
test: /\.scss$/,
use: ExtractTextPlugin.extract({
use: [{
loader: 'css-loader'
},{
loader: 'sass-loader'
}],
fallback: 'style-loader'
})
}
]
},
output : {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js',
//libraryTarget: 'commonjs2'
},
resolve : {
extensions: [
'.js', '.json'
],
modules: [
path.join(__dirname, 'src'),
'node_modules'
]
},
plugins : [
new ExtractTextPlugin({
filename: "[name].[contenthash].css"
}),
new webpack.NamedModulesPlugin(),
new HtmlWebpackPlugin({title: 'Neuroevolution of snakes', template: 'src/index.html.ejs'})
]
}