diff --git a/build/build.sh b/build/build.sh index 86c9a6217..310fbcfd8 100755 --- a/build/build.sh +++ b/build/build.sh @@ -69,7 +69,7 @@ echo -e "\033[0;32mCompiling UI\x1b[m" npm rebuild node-sass node extractLocals.js node_modules/.bin/node-sass --output dist/css --sourcemap=none scss/ - node_modules/.bin/webpack + node_modules/.bin/webpack --config webpack.prod.js cp -r dist/* "$ROOT/app/dist/" ) diff --git a/ui/watch.bat b/ui/watch.bat index 0c064759a..000bbc6df 100644 --- a/ui/watch.bat +++ b/ui/watch.bat @@ -8,4 +8,4 @@ for %%F in ( if not defined found EXIT node %~dp0\node_modules\node-sass\bin\node-sass --output %~dp0\..\app\dist\css --sourcemap=none %~dp0\scss -%~dp0\node_modules\.bin\webpack --config %~dp0\webpack.dev.config.js --progress --colors --watch \ No newline at end of file +%~dp0\node_modules\.bin\webpack --config %~dp0\webpack.dev.js --progress --colors --watch \ No newline at end of file diff --git a/ui/webpack.config.js b/ui/webpack.config.js deleted file mode 100644 index e1ef528fa..000000000 --- a/ui/webpack.config.js +++ /dev/null @@ -1,60 +0,0 @@ -const path = require("path"); -const webpack = require("webpack") -const appPath = path.resolve(__dirname, "js"); - -process.traceDeprecation = true; - -const PATHS = { - app: path.join(__dirname, "app"), - dist: path.join(__dirname, "dist") -}; - -module.exports = { - entry: ["babel-polyfill", "./js/main.js"], - output: { - path: path.join(PATHS.dist, "js"), - publicPath: "/js/", - filename: "bundle.js" - }, - devtool: "source-map", - resolve: { - modules: [appPath, "node_modules"], - extensions: [".js", ".jsx", ".css"] - }, - plugins: [ - new webpack.DefinePlugin({ - ENV: JSON.stringify("production"), - }), - ], - module: { - rules: [ - { - test: /\.jsx?$/, - enforce: "pre", - loaders: ["eslint"], - // define an include so we check just the files we need - include: PATHS.app - }, - { - test: /\.node$/, - use: ["node-loader"] - }, - { - test: /\.css$/, - use: ["style-loader", "css-loader"] - }, - { - test: /\.jsx?$/, - exclude: /node_modules/, - use: { - loader: "babel-loader", - options: { - cacheDirectory: true, - presets: [ "es2015", "react", "stage-2" ] - } - } - } - ] - }, - target: "electron-main", -}; diff --git a/ui/webpack.dev.config.js b/ui/webpack.dev.config.js deleted file mode 100644 index 604aa14d4..000000000 --- a/ui/webpack.dev.config.js +++ /dev/null @@ -1,66 +0,0 @@ -const path = require("path"); -const webpack = require("webpack") -const WebpackNotifierPlugin = require("webpack-notifier") - -const appPath = path.resolve(__dirname, "js"); - -const PATHS = { - app: path.join(__dirname, "app"), - dist: path.join(__dirname, "..", "app", "dist") -}; - -module.exports = { - entry: ["babel-polyfill", "./js/main.js"], - output: { - path: path.join(PATHS.dist, "js"), - publicPath: "/js/", - filename: "bundle.js", - pathinfo: true - }, - cache: true, - devtool: "eval", - resolve: { - modules: [appPath, "node_modules"], - extensions: [".js", ".jsx", ".css"] - }, - plugins: [ - new WebpackNotifierPlugin(), - new webpack.DefinePlugin({ - ENV: JSON.stringify("development"), - }), - new webpack.LoaderOptionsPlugin({ - debug: true - }) - ], - module: { - rules: [ - { - test: /\.jsx?$/, - enforce: "pre", - loaders: ["eslint"], - // define an include so we check just the files we need - include: PATHS.app - }, - { - test: /\.node$/, - use: ["node-loader"] - }, - { - test: /\.css$/, - use: ["style-loader", "css-loader"] - }, - { - test: /\.jsx?$/, - exclude: /node_modules/, - use: { - loader: "babel-loader", - options: { - cacheDirectory: true, - presets: [ "es2015", "react", "stage-2" ] - } - } - } - ] - }, - target: "electron-main", -}; diff --git a/ui/webpack.dev.js b/ui/webpack.dev.js index 073dfdc23..e5d72b83b 100644 --- a/ui/webpack.dev.js +++ b/ui/webpack.dev.js @@ -4,8 +4,14 @@ const WebpackNotifierPlugin = require("webpack-notifier") const merge = require('webpack-merge'); const common = require('./webpack.common.js'); + +const PATHS = { + dist: path.join(__dirname, "..", "app", "dist") +}; + module.exports = merge(common, { output: { + path: path.join(PATHS.dist, "js"), pathinfo: true }, cache: true,