From bda1aac9bd1c6f4a40ce332111164121369f5ec1 Mon Sep 17 00:00:00 2001 From: Bazire Houssin Date: Mon, 11 Sep 2017 17:21:32 +0200 Subject: [PATCH] Removing focus-devtools if not DEV is not to true, updating to beta2 --- package.json | 3 ++- src/config/base.js | 13 ++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index f7b9e31..c74ca62 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "webpack-focus", - "version": "1.0.0-beta1", + "version": "1.0.0-beta2", "description": "Focus webpack config", "main": "./index.js", "bin": { @@ -47,6 +47,7 @@ "html-webpack-plugin": "2.30.1", "lodash": "4.17.4", "node-sass": "4.5.3", + "null-loader": "0.1.1", "postcss-cssnext": "3.0.2", "postcss-flexbugs-fixes": "3.2.0", "postcss-import": "10.0.0", diff --git a/src/config/base.js b/src/config/base.js index 43e1830..71f4360 100644 --- a/src/config/base.js +++ b/src/config/base.js @@ -118,12 +118,6 @@ const baseConfig = (environnement, definedVariables) => { config.addPlugin(70, new WatchMissingNodeModulesPlugin(path.join(process.cwd(), 'node_modules'))); config.addPlugin(80, new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/)); - - // Not working well - // if (!parsedEnv.DEV) { - // config.addPlugin(90, new webpack.IgnorePlugin(/focus-devtools/)); - // } - if (parsedEnv.ANALYZE) { config.addPlugin(100, new BundleAnalyzerPlugin()); } @@ -188,9 +182,14 @@ const baseConfig = (environnement, definedVariables) => { presets: ['babel-preset-focus'] } }], - exclude: { and: [/node_modules/, { not: [/focus-components/] }] } // FIXME for now, change /focus-*/ to /focus-components/ + exclude: { and: [/node_modules/, { not: [/focus-components/, /focus-core/] }] } // FIXME for now, change /focus-*/ to /focus-components/ }); + // Ignoring devtools if not DEV + if (!parsedEnv.DEV) { + config.addSimpleLoader(25, /focus-devtools/, 'null-loader'); + } + // Loader pour le SASS (Extraction du fichier JS, vers un fichier CSS indépendant, cf plugin) config.addComplexLoader(30, cssLoaderBuilder(parsedEnv));