-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.dev.js
More file actions
53 lines (51 loc) · 1.5 KB
/
webpack.config.dev.js
File metadata and controls
53 lines (51 loc) · 1.5 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
53
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
entry: {
'index': __dirname + '/public/scripts/praise.js'
},
output: {
path: __dirname + '/build/public',
publicPath: 'localhost:8080/build/public',
filename: '[name].bundle.[hash:8].js'
},
devServer: {
proxy: {
"**": "http://localhost:3002"
},
},
module: {
rules: [{
test: /(\.jsx|\.js)$/,
use: {
loader: "babel-loader"
},
exclude: /node_modules/
}, {
test: /\.css$/,
use: ExtractTextPlugin.extract({
fallback: "style-loader",
use: [{
loader: "css-loader"
}],
})
}]
},
plugins: [
new HtmlWebpackPlugin({
filename: './views/index.html',
template: "./public/views/index.html",
chunks: []
}),
new HtmlWebpackPlugin({
filename: './views/layout.html',
template: "./public/views/layout.html",
chunks: ["index"],
inject: 'head'
}),
new webpack.optimize.OccurrenceOrderPlugin(),
new webpack.optimize.UglifyJsPlugin(),
new ExtractTextPlugin("style.[hash:8].css")
]
}