-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy path.webpack.config.js
46 lines (44 loc) · 1.13 KB
/
.webpack.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
var config = require('./.build.config');
var path = require('path');
var webpackDevtool = '#source-map';
var webpackWatch = false;
if (process.env.NODE_ENV === 'development' ||
process.env.NODE_ENV === 'testing') {
// eval-source-map is the same thing as source-map,
// except with caching. Don't use in production.
webpackDevtool = '#eval-source-map';
webpackWatch = true;
}
module.exports = {
devtool: webpackDevtool,
entry: [config.files.srcJS],
output: {filename: config.files.distJS},
module: {
loaders: [{
exclude: /node_modules/,
loader: 'babel-loader',
query: {
cacheDirectory: true
},
test: /\.js$/
},
{ test: /\.json$/, loader: 'json-loader' }],
preLoaders: [{
test: /\.js$/,
loader: 'source-map-loader',
exclude: /node_modules/
}],
postLoaders: [{
loader: 'transform/cacheable?envify'
}]
},
resolve: {
root: path.resolve(__dirname),
extensions: ['', '.js'],
alias: {
PluginSDK: 'src/js/plugin-bridge/PluginSDK',
PluginTestUtils: 'src/js/plugin-bridge/PluginTestUtils'
}
},
watch: webpackWatch
};