-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
52 lines (51 loc) · 1.55 KB
/
Copy pathwebpack.config.js
File metadata and controls
52 lines (51 loc) · 1.55 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 webpack = require('webpack');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
entry: __dirname + '/src/index.js',
devtool: 'source-map',
output: {
path: __dirname + '/dist',
filename: 'app.bundle.js',
publicPath: '/'
},
devServer: {
port: 3000,
contentBase: __dirname + '/dist',
historyApiFallback: true
},
stats: {
errorDetails: true
},
module: {
rules: [
{
test: /.js?$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: ['env', 'react', 'stage-2', 'flow'],
plugins: [
["transform-runtime", {
"polyfill": false,
"regenerator": true
}]
]
}
},
}, {
test: /\.css$/,
use: ExtractTextPlugin.extract({ fallback: "style-loader", use: "css-loader" })
},
{
test: /\.(ttf|eot|svg|woff|woff2|png|gif)$/,
use: 'url-loader?limit=10000'
}
]
},
plugins: [new ExtractTextPlugin('style.bundle.css'), new HtmlWebpackPlugin({
filename: 'index.html',
template: __dirname + '/src/index.html'
})]
}