1 | const HtmlWebpackPlugin = require('html-webpack-plugin')
|
2 | const path = require('path')
|
3 | const webpack = require('webpack')
|
4 |
|
5 | module.exports = {
|
6 | devtool: 'eval',
|
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.NoErrorsPlugin()
|
22 | ],
|
23 | module: {
|
24 | loaders: [
|
25 | {
|
26 | test: /\.js$/,
|
27 | loader: 'babel',
|
28 | exclude: path.join(__dirname, 'node_modules')
|
29 | },
|
30 | {
|
31 | test: /\.css$/,
|
32 | loaders: ['style', 'css?modules&importLoaders=1', 'cssnext'],
|
33 | exclude: path.join(__dirname, 'node_modules')
|
34 | }
|
35 | ]
|
36 | },
|
37 | devServer: {
|
38 | contentBase: 'build',
|
39 | port: 3333
|
40 | }
|
41 | }
|