forked from zalmoxisus/crossbuilder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbase.config.js
50 lines (48 loc) · 1.05 KB
/
base.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
import path from 'path';
import webpack from 'webpack';
const baseConfig = ({ input, output = {}, globals = {}, plugins, loaders }) => ({
entry: input,
output: {
filename: 'js/[name].bundle.js',
chunkFilename: 'js/[id].chunk.js',
...output
},
plugins: [
new webpack.DefinePlugin(globals),
...(plugins ||
[
new webpack.optimize.DedupePlugin(),
new webpack.optimize.UglifyJsPlugin({
comments: false,
compress: {
warnings: false
},
output: {
ascii_only: true,
beautify: false,
}
})
])
],
resolve: {
alias: {
app: path.join(__dirname, '../src/app'),
extension: path.join(__dirname, '../src/browser/extension')
},
extensions: ['', '.js']
},
module: {
loaders: [
...(loaders || [{
test: /\.js$/,
loader: 'babel',
exclude: /node_modules/
}]),
{
test: /\.css?$/,
loaders: ['style', 'raw']
}
]
}
});
export default baseConfig;