forked from mosufy/lumen-react
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.staging.config.js
58 lines (56 loc) · 1.36 KB
/
webpack.staging.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
/**
* webpack.config.js
*
* @date 14/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: 'eval',
output: {
path: path.join(__dirname, "public", "js"),
filename: '[name]-staging-[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.DefinePlugin({
'process.env': {
'API_HOST': JSON.stringify('https://lumen.staging.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.staging.manifest.json'
})
]
};