-
Notifications
You must be signed in to change notification settings - Fork 5
/
webpack.config.base.js
63 lines (53 loc) · 1.32 KB
/
webpack.config.base.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 NODE_ENV = process.env.NODE_ENV;
var env = {
production: NODE_ENV === 'production',
staging: NODE_ENV === 'staging',
test: NODE_ENV === 'test',
development: NODE_ENV === 'development' || typeof NODE_ENV === 'undefined'
};
Object.assign(env, {
build: (env.production || env.staging)
});
module.exports = {
target: 'web',
entry: [
'babel-polyfill',
'./client/main.jsx'
],
output: {
path: path.join(process.cwd(), '/client'),
pathInfo: true,
publicPath: 'http://localhost:3000/client/',
filename: 'main.js'
},
resolve: {
root: path.join(__dirname, ''),
modulesDirectories: [
'web_modules',
'node_modules',
'client'
],
extensions: ['', '.webpack.js', '.web.js', '.js', '.jsx']
},
plugins: [
new webpack.DefinePlugin({
__DEV__: env.development,
__STAGING__: env.staging,
__PRODUCTION__: env.production,
__CURRENT_ENV__: '\'' + (NODE_ENV) + '\''
}),
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery",
})
],
module: {
loaders: [
{test: /\.scss$/, loader: 'style!css!autoprefixer?browsers=last 2 version!sass?outputStyle=expanded'},
{test: /\.css$/, loader: 'style-loader!css-loader'}
],
noParse: /\.min\.js/
}
};