-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathwebpack.config.production.js
More file actions
executable file
·59 lines (58 loc) · 1.28 KB
/
Copy pathwebpack.config.production.js
File metadata and controls
executable file
·59 lines (58 loc) · 1.28 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
54
55
56
57
58
59
/**
* Webpack production configuration.
*/
var path = require('path');
var webpack = require('webpack');
module.exports = {
entry: './scripts/app.js',
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js',
publicPath: '/',
},
plugins: [
new webpack.DefinePlugin({
__DEV__: JSON.stringify(JSON.parse(process.env.BUILD_DEV || 'true')),
})
],
module: {
loaders: [
{
test: /\.json$/,
loaders: [
'json-loader'
]
},
{
test: /\.jsx?$/,
exclude: /node_modules/,
loaders: [
'babel-loader'
]
},
{
test: /\.s?css$/,
loaders: [
'style-loader',
'css-loader',
'autoprefixer-loader',
'sass-loader',
]
},
{
test: /\.(jpe?g|png|gif|svg)$/i,
loaders: [
'file?hash=sha512&digest=hex&name=[hash].[ext]',
'image-webpack?bypassOnDebug&optimizationLevel=7&interlaced=false'
]
}
]
},
// Joi depends on node core modules from a newer version of node.
// This stubs them out during the webpack build.
// See here https://webpack.github.io/docs/configuration.html#node
node: {
net: "empty",
dns: "empty",
},
};