-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathwebpack.build.js
46 lines (43 loc) · 1.19 KB
/
webpack.build.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
const webpack = require('webpack');
const LodashModuleReplacementPlugin = require('lodash-webpack-plugin');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const bourbon = require('node-bourbon').includePaths;
const config = require('./webpack.config.js');
config.devtool = 'source-map';
config.entry = {
'sanji-ui': './component/index.js'
};
config.output.filename = 'sanji-cellular-ui.js';
config.output.libraryTarget = 'umd';
config.output.library = 'sjCellular';
config.externals = ['angular', 'sanji-core-ui'];
config.module.rules = [
{
test: /\.scss$/,
loader: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: [
{ loader: 'css-loader', options: { importLoaders: 1, minimize: true } },
'postcss-loader',
{
loader: 'sass-loader',
options: {
includePaths: bourbon
}
}
]
})
}
].concat(config.module.rules);
config.plugins.push(
new ExtractTextPlugin('sanji-cellular-ui.css'),
new LodashModuleReplacementPlugin(),
new webpack.optimize.UglifyJsPlugin({
compress: {
screw_ie8: true,
warnings: false,
dead_code: true
}
})
);
module.exports = config;