1bb9420d33a97ac4f7f3f4d8105af12c6e3343d2
[sdc.git] / openecomp-ui / webpack.production.js
1 'use strict';
2
3 let path = require('path');
4 let webpack = require('webpack');
5
6 let webpackCommon = require('./webpack.common');
7
8 let webpackDevConfig = Object.assign({}, webpackCommon, {
9         devtool: undefined,
10         cache: true,
11         output: {
12                 path: path.join(__dirname, 'dist'),
13                 publicPath: '/onboarding/',
14                 filename: '[name].js'
15         },
16         resolveLoader: {
17                 modules: [path.join(__dirname, 'node_modules'), path.resolve('.')],
18                 alias: {
19                         'config-json-loader': 'tools/webpack/config-json-loader/index.js'
20                 }
21         },
22         plugins: [
23                 new webpack.DefinePlugin({
24                         'process.env': {
25                                 // This has effect on the react lib size
26                                 'NODE_ENV': JSON.stringify('production')
27                         },
28                         DEBUG: false,
29                         DEV: false
30                 }),
31                 new webpack.optimize.UglifyJsPlugin(),
32                 new webpack.LoaderOptionsPlugin({
33                         options: {
34                                 eslint: {
35                                         configFile: './.eslintrc',
36                                         emitError: true,
37                                         emitWarning: true,
38                                         failOnError: true
39                                 }
40                         }
41                 })
42         ]
43 });
44
45 module.exports = webpackDevConfig;