-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
50 lines (48 loc) · 1.43 KB
/
webpack.config.js
File metadata and controls
50 lines (48 loc) · 1.43 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
const buildsettings = require('./buildsettings');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const settings = require('./settings')();
const path = require('path');
const webpack = require('webpack');
const clientJsPackageUrl = buildsettings.CLIENT_HOST + buildsettings.CLIENT_JS_PACKAGE_PATH;
const clientVendorJsPackageUrl = buildsettings.CLIENT_HOST + buildsettings.CLIENT_VENDOR_JS_PACKAGE_PATH;
module.exports = {
entry: {
app: "./js/client/client.js",
vendor: ['immutable', 'react', 'react-dom', 'react-redux', 'redux', 'redux-thunk'],
},
output: {
path: path.join(__dirname, 'build/static/client'),
filename: "bundle.js"
},
resolve: {
root: __dirname,
extensions: ['', '.js', '.scss'],
alias: {
js: 'js',
style: 'style',
}
},
module: {
loaders: [
{
test: /\.jsx?$/,
exclude: /node_modules/,
loader: 'babel', // 'babel-loader' is also a legal name to reference
query: { presets: ['es2015', 'react'] }
}, {
test: /\.scss$/,
loaders: ["style", "css", "sass"]
},
]
},
plugins: [
new HtmlWebpackPlugin({
filename: 'client.html',
template: 'client/html/client.html',
settings: settings,
CLIENT_JS_PACKAGE_URL: clientJsPackageUrl,
CLIENT_VENDOR_JS_PACKAGE_URL: clientVendorJsPackageUrl,
}),
new webpack.optimize.CommonsChunkPlugin('vendor', 'vendor.bundle.js'),
],
}