-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.production.config.js
63 lines (62 loc) · 1.49 KB
/
webpack.production.config.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
52
53
54
55
56
57
58
59
60
61
62
63
var Path = require('path')
var webpack = require('webpack')
var WebpackNotifierPlugin = require('webpack-notifier')
var HtmlWebpackPlugin = require('html-webpack-plugin')
module.exports = {
entry: [
'./src/boot.jsx'
],
output: {
path: Path.join(__dirname, 'build'),
filename: 'bundle.js',
publicPath: '/'
},
module: {
loaders: [
{
test: /\.(jsx|js)$/,
exclude: /node_modules/,
loaders: ['babel-loader'],
include: Path.join(__dirname, 'src/')
},
{
test: /\.css$/, loader: 'style-loader!css-loader'
},
{
test: /\.scss$/, loader: 'style-loader!css-loader!sass-loader!postcss-loader'
},
{
test: /\.json$/, loader: 'json-loader'
},
{
test: /\.(ttf|eot|png|gif|jpg|woff|woff2|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loader: 'url-loader?limit=8192'
},
{
test: /\.(html|png)$/,
loader: 'file-loader?name=[path][name].[ext]&context=./src'
}
]
},
resolve: {
extensions: ['.js', '.jsx']
},
devServer: {
inline: true,
hot: true,
historyApiFallback: true
},
plugins: [
new webpack.DefinePlugin({
'process.env.NODE_ENV': '"production"',
SERVER_URL: '"https://plus.nctu.edu.tw/api"'
}),
new webpack.NoEmitOnErrorsPlugin(),
new webpack.HotModuleReplacementPlugin(),
new WebpackNotifierPlugin(),
new HtmlWebpackPlugin({
template: 'src/index.ejs',
inject: 'body'
})
]
}