forked from mosufy/lumen-react
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.production.config.js
64 lines (62 loc) · 1.54 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
64
/**
* webpack.production.config.js
*
* @date 27/10/2016
* @author Mosufy <[email protected]>
* @copyright Copyright (c) Mosufy
*/
var path = require("path");
var webpack = require('webpack');
var AssetsPlugin = require('assets-webpack-plugin');
module.exports = {
cache: true,
entry: {
bundle: ["./resources/app/index.js"]
},
devtool: 'cheap-module-source-map',
output: {
path: path.join(__dirname, "public", "js"),
filename: '[name]-production-[hash].js'
},
resolve: {
extensions: ['', '.js', '.jsx']
},
module: {
loaders: [
{
test: /\.jsx?$/,
exclude: /node_modules/,
loader: 'babel',
// include: [
// path.join(__dirname, "public")
// ],
query: {
cacheDirectory: true,
presets: ['es2015', 'stage-0', 'react']
}
}
]
},
plugins: [
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
}
}),
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify('production'),
'API_HOST': JSON.stringify('https://lumen-react.mosufy.com/v1'),
'API_CLIENT_ID': JSON.stringify('6fC2745co07D4yW7X9saRHpJcE0sm0MT'),
'API_CLIENT_SECRET': JSON.stringify('KLqMw5D7g1c6KX23I72hx5ri9d16GJDW')
}
}),
new webpack.DllReferencePlugin({
context: ".",
manifest: require(path.join(__dirname, 'public', 'js', 'dll', 'vendor-manifest.json'))
}),
new AssetsPlugin({
filename: 'webpack.production.manifest.json'
})
]
};