From 7fdf733a64670fceefc3ded35cfa581e1c458179 Mon Sep 17 00:00:00 2001 From: Einav Weiss Keidar Date: Tue, 20 Mar 2018 14:45:40 +0200 Subject: Adding Prettier and fixing up eslint version Issue-ID: SDC-1094 Change-Id: Ie83ad95a03899345dd90235daf0323cbe3bc6afd Signed-off-by: Einav Weiss Keidar --- openecomp-ui/webpack.production.js | 89 +++++++++++++++++++++----------------- 1 file changed, 49 insertions(+), 40 deletions(-) (limited to 'openecomp-ui/webpack.production.js') diff --git a/openecomp-ui/webpack.production.js b/openecomp-ui/webpack.production.js index 2dea2170ae..22da77e6ed 100644 --- a/openecomp-ui/webpack.production.js +++ b/openecomp-ui/webpack.production.js @@ -10,48 +10,57 @@ let webpackCommon = require('./webpack.common'); // copying the common config let webpackProdConfig = cloneDeep(webpackCommon); // setting production settings -assign( webpackProdConfig, { - 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 - } - } - }) - ] +assign(webpackProdConfig, { + 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 + } + } + }) + ] }); -webpackProdConfig.module.rules = webpackProdConfig.module.rules.filter(rule => ((rule.enforce !== 'pre') || (rule.enforce === 'pre' && rule.loader !== 'source-map-loader'))); +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', '')); - } + 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' }] }); -webpackProdConfig.module.rules.push({test: /config.json$/, use: [{loader:'config-json-loader'}]}); module.exports = webpackProdConfig; -- cgit 1.2.3-korg