1 | const HtmlWebpackPlugin = require('html-webpack-plugin')
|
2 | const path = require('path')
|
3 | const webpack = require('webpack')
|
4 |
|
5 | module.exports = {
|
6 | devtool: 'source-map',
|
7 | entry: [
|
8 | 'babel/polyfill',
|
9 | './website/index.js'
|
10 | ],
|
11 | output: {
|
12 | path: 'build',
|
13 | filename: 'static/[name].js'
|
14 | },
|
15 | plugins: [
|
16 | new HtmlWebpackPlugin({
|
17 | filename: 'index.html',
|
18 | inject: true,
|
19 | template: './website/index.html'
|
20 | }),
|
21 | new webpack.DefinePlugin({
|
22 | 'process.env': {
|
23 | 'NODE_ENV': JSON.stringify('production')
|
24 | }
|
25 | })
|
26 | ],
|
27 | module: {
|
28 | loaders: [
|
29 | {
|
30 | test: /\.js$/,
|
31 | loader: 'babel',
|
32 | exclude: path.join(__dirname, 'node_modules')
|
33 | },
|
34 | {
|
35 | test: /\.css$/,
|
36 | loaders: ['style', 'css?modules&importLoaders=1', 'cssnext'],
|
37 | exclude: path.join(__dirname, 'node_modules')
|
38 | }
|
39 | ]
|
40 | }
|
41 | }
|