forked from DAVFoundation/missions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.stg.js
46 lines (44 loc) · 1.63 KB
/
webpack.stg.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 path = require('path');
const webpack = require('webpack');
const getCommon = require('./webpack.common.js');
const merge = require('webpack-merge');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
process.env.NODE_ENV = 'production';
module.exports = merge(getCommon(process.env.NODE_ENV), {
devtool: 'cheap-module-source-map',
plugins: [
new CleanWebpackPlugin(['dist']),
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify(process.env.NODE_ENV),
MISSION_CONTROL_HOST: JSON.stringify('http://missioncontrol-stg.us-east-1.elasticbeanstalk.com'),
},
}),
new HtmlWebpackPlugin({
filename: 'index.html',
chunks: ['vendor', 'drone_simulation'],
template: path.resolve(__dirname, 'src/index.html'),
favicon: path.resolve(__dirname, 'src/favicon.ico'),
}),
new HtmlWebpackPlugin({
filename: 'delivery_drones.html',
chunks: ['vendor', 'delivery_drones'],
template: path.resolve(__dirname, 'src/index.html'),
favicon: path.resolve(__dirname, 'src/favicon.ico'),
}),
new CopyWebpackPlugin([
{ from: 'src/images', to: 'images' },
{ from: 'src/browserconfig.xml' },
{ from: 'src/manifest.json' },
{ from: 'src/lib/mapbox-gl-rtl-text.js.min' , to: 'lib' },
]),
new ExtractTextPlugin('styles.css'),
new UglifyJSPlugin({
sourceMap: true,
}),
],
});