diff --git a/package.json b/package.json index c3c4a058..884a28ec 100644 --- a/package.json +++ b/package.json @@ -5,9 +5,9 @@ "description": "desktop application for the lightning network", "scripts": { "build": "concurrently --raw \"npm run build-main\" \"npm run build-renderer\"", - "build-dll": "cross-env NODE_ENV=development node --trace-warnings -r babel-register ./node_modules/webpack/bin/webpack --config webpack.config.renderer.dev.dll.js --colors", - "build-main": "cross-env NODE_ENV=production node --trace-warnings -r babel-register ./node_modules/webpack/bin/webpack --config webpack.config.main.prod.js --colors", - "build-renderer": "cross-env NODE_ENV=production node --trace-warnings -r babel-register ./node_modules/webpack/bin/webpack --config webpack.config.renderer.prod.js --colors", + "build-dll": "node --trace-warnings -r babel-register ./node_modules/webpack/bin/webpack --config webpack.config.renderer.dev.dll.js --colors", + "build-main": "node --trace-warnings -r babel-register ./node_modules/webpack/bin/webpack --config webpack.config.main.prod.js --colors", + "build-renderer": "node --trace-warnings -r babel-register ./node_modules/webpack/bin/webpack --config webpack.config.renderer.prod.js --colors", "dev": "cross-env START_HOT=1 npm run start-renderer-dev", "flow": "flow", "flow-typed": "rimraf flow-typed/npm && flow-typed install --overwrite || true", @@ -28,7 +28,7 @@ "prestart": "npm run build", "start": "cross-env NODE_ENV=production electron ./app/", "start-main-dev": "cross-env HOT=1 NODE_ENV=development electron -r babel-register ./app/main.dev", - "start-renderer-dev": "cross-env NODE_ENV=development node --trace-warnings -r babel-register ./node_modules/webpack-dev-server/bin/webpack-dev-server --config webpack.config.renderer.dev.js", + "start-renderer-dev": "node --trace-warnings -r babel-register ./node_modules/webpack-dev-server/bin/webpack-dev-server --config webpack.config.renderer.dev.js", "test": "cross-env NODE_ENV=test BABEL_DISABLE_CACHE=1 node --trace-warnings ./test/runTests.js", "test-ci": "npm run package && npm run test && npm run test-e2e", "test-all": "npm run lint && npm run lint-styles && npm run flow && npm run build && npm run test && npm run test-e2e", diff --git a/webpack.config.base.js b/webpack.config.base.js index 20d55222..e6cc26ea 100644 --- a/webpack.config.base.js +++ b/webpack.config.base.js @@ -3,7 +3,6 @@ */ import path from 'path' -import webpack from 'webpack' import { dependencies as externals } from './app/package.json' export default { @@ -39,12 +38,6 @@ export default { modules: [path.join(__dirname, 'app'), 'node_modules'] }, - plugins: [ - new webpack.DefinePlugin({ - 'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'production') - }) - ], - optimization: { namedModules: true } diff --git a/webpack.config.main.prod.js b/webpack.config.main.prod.js index 0e6c3a5d..c0b8bccb 100644 --- a/webpack.config.main.prod.js +++ b/webpack.config.main.prod.js @@ -39,13 +39,9 @@ export default merge.smart(baseConfig, { * * Useful for allowing different behaviour between development builds and * release builds - * - * NODE_ENV should be production so that modules do not perform certain - * development checks */ - new webpack.DefinePlugin({ - 'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'production'), - 'process.env.DEBUG_PROD': JSON.stringify(process.env.DEBUG_PROD || 'false') + new webpack.EnvironmentPlugin({ + DEBUG_PROD: false }) ], diff --git a/webpack.config.renderer.dev.dll.js b/webpack.config.renderer.dev.dll.js index db9ab9a8..d15eccd7 100644 --- a/webpack.config.renderer.dev.dll.js +++ b/webpack.config.renderer.dev.dll.js @@ -178,19 +178,6 @@ export default merge.smart(baseConfig, { name: '[name]' }), - /** - * Create global constants which can be configured at compile time. - * - * Useful for allowing different behaviour between development builds and - * release builds - * - * NODE_ENV should be production so that modules do not perform certain - * development checks - */ - new webpack.DefinePlugin({ - 'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'development') - }), - new webpack.LoaderOptionsPlugin({ debug: true, options: { diff --git a/webpack.config.renderer.dev.js b/webpack.config.renderer.dev.js index 4757381e..ee40841e 100644 --- a/webpack.config.renderer.dev.js +++ b/webpack.config.renderer.dev.js @@ -212,22 +212,6 @@ export default merge.smart(baseConfig, { // multiStep: true }), - /** - * Create global constants which can be configured at compile time. - * - * Useful for allowing different behaviour between development builds and - * release builds - * - * NODE_ENV should be production so that modules do not perform certain - * development checks - * - * By default, use 'development' as NODE_ENV. This can be overriden with - * 'staging', for example, by changing the ENV variables in the npm scripts - */ - new webpack.DefinePlugin({ - 'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'development') - }), - new webpack.LoaderOptionsPlugin({ debug: true }), diff --git a/webpack.config.renderer.prod.js b/webpack.config.renderer.prod.js index 9e3f7138..42c25162 100644 --- a/webpack.config.renderer.prod.js +++ b/webpack.config.renderer.prod.js @@ -3,7 +3,6 @@ */ import path from 'path' -import webpack from 'webpack' import ExtractTextPlugin from 'extract-text-webpack-plugin' import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer' import merge from 'webpack-merge' @@ -143,19 +142,6 @@ export default merge.smart(baseConfig, { }, plugins: [ - /** - * Create global constants which can be configured at compile time. - * - * Useful for allowing different behaviour between development builds and - * release builds - * - * NODE_ENV should be production so that modules do not perform certain - * development checks - */ - new webpack.DefinePlugin({ - 'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'production') - }), - new ExtractTextPlugin('style.css'), new BundleAnalyzerPlugin({