aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-ui/webpack.production.js
blob: 1bb9420d33a97ac4f7f3f4d8105af12c6e3343d2 (plain)
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
'use strict';

let path = require('path');
let webpack = require('webpack');

let webpackCommon = require('./webpack.common');

let webpackDevConfig = Object.assign({}, webpackCommon, {
	devtool: undefined,
	cache: true,
	output: {
		path: path.join(__dirname, 'dist'),
		publicPath: '/onboarding/',
		filename: '[name].js'
	},
	resolveLoader: {
		modules: [path.join(__dirname, 'node_modules'), path.resolve('.')],
		alias: {
			'config-json-loader': 'tools/webpack/config-json-loader/index.js'
		}
	},
	plugins: [
		new webpack.DefinePlugin({
			'process.env': {
				// This has effect on the react lib size
				'NODE_ENV': JSON.stringify('production')
			},
			DEBUG: false,
			DEV: false
		}),
		new webpack.optimize.UglifyJsPlugin(),
		new webpack.LoaderOptionsPlugin({
			options: {
				eslint: {
					configFile: './.eslintrc',
					emitError: true,
					emitWarning: true,
					failOnError: true
				}
			}
		})
	]
});

module.exports = webpackDevConfig;