-
Notifications
You must be signed in to change notification settings - Fork 125
Expand file tree
/
Copy pathwebpack.standalone.config.js
More file actions
39 lines (36 loc) · 923 Bytes
/
webpack.standalone.config.js
File metadata and controls
39 lines (36 loc) · 923 Bytes
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
const webpack = require('webpack');
const path = require('path');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const config = require('./webpack.dist.config');
// Complete
const conf1 = Object.assign({}, config);
conf1.output = Object.assign({}, conf1.output, {
path: path.join(__dirname, './dist/standalone'),
libraryTarget: 'umd',
});
conf1.externals = {
react: 'react',
};
conf1.target = 'web';
// Minified
const conf2 = Object.assign({}, conf1);
conf2.output = Object.assign({}, conf2.output, {
filename: 'Typist.min.js',
});
conf2.plugins = [
new ExtractTextPlugin('Typist.min.css', {allChunks: true}),
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify('production'),
},
}),
new webpack.optimize.UglifyJsPlugin({
output: {
comments: false,
},
compress: {
warnings: false,
},
}),
];
module.exports = [conf1, conf2];