diff options
author | Avi Ziv <avi.ziv@amdocs.com> | 2017-07-18 19:45:38 +0300 |
---|---|---|
committer | Avi Ziv <avi.ziv@amdocs.com> | 2017-07-18 19:45:38 +0300 |
commit | b8e2faf476202b6ffe61bc3a9a37df1304881d40 (patch) | |
tree | f78b8c0517d8e16c5ae610bf8b49f68ea8a312a1 /openecomp-ui/webpack.production.js | |
parent | 75aacbbe1acf78fa53378f07f0a8c7769449a17e (diff) |
[SDC] Onboarding 1710 rebase.
Change-Id: If3b6b81d221fde13908f1e8160db6f7d9433c535
Signed-off-by: Avi Ziv <avi.ziv@amdocs.com>
Diffstat (limited to 'openecomp-ui/webpack.production.js')
-rw-r--r-- | openecomp-ui/webpack.production.js | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/openecomp-ui/webpack.production.js b/openecomp-ui/webpack.production.js index 1bb9420d33..2dea2170ae 100644 --- a/openecomp-ui/webpack.production.js +++ b/openecomp-ui/webpack.production.js @@ -3,9 +3,14 @@ let path = require('path'); let webpack = require('webpack'); +let cloneDeep = require('lodash/cloneDeep'); +let assign = require('lodash/assign'); let webpackCommon = require('./webpack.common'); -let webpackDevConfig = Object.assign({}, webpackCommon, { +// copying the common config +let webpackProdConfig = cloneDeep(webpackCommon); +// setting production settings +assign( webpackProdConfig, { devtool: undefined, cache: true, output: { @@ -42,4 +47,11 @@ let webpackDevConfig = Object.assign({}, webpackCommon, { ] }); -module.exports = webpackDevConfig; +webpackProdConfig.module.rules = webpackProdConfig.module.rules.filter(rule => ((rule.enforce !== 'pre') || (rule.enforce === 'pre' && rule.loader !== 'source-map-loader'))); +webpackProdConfig.module.rules.forEach(loader => { + if (loader.use && loader.use[0].loader === 'style-loader') { + loader.use = loader.use.map(loaderObj => loaderObj.loader.replace('?sourceMap', '')); + } +}); +webpackProdConfig.module.rules.push({test: /config.json$/, use: [{loader:'config-json-loader'}]}); +module.exports = webpackProdConfig; |