Merge pull request #724 from seanyesmunt/webpack-fix
fix dev build path and update webpack file names in build.sh/watch.bat
This commit is contained in:
commit
4c94f65493
5 changed files with 8 additions and 128 deletions
|
@ -69,7 +69,7 @@ echo -e "\033[0;32mCompiling UI\x1b[m"
|
||||||
npm rebuild node-sass
|
npm rebuild node-sass
|
||||||
node extractLocals.js
|
node extractLocals.js
|
||||||
node_modules/.bin/node-sass --output dist/css --sourcemap=none scss/
|
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/"
|
cp -r dist/* "$ROOT/app/dist/"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -8,4 +8,4 @@ for %%F in (
|
||||||
if not defined found EXIT
|
if not defined found EXIT
|
||||||
|
|
||||||
node %~dp0\node_modules\node-sass\bin\node-sass --output %~dp0\..\app\dist\css --sourcemap=none %~dp0\scss
|
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
|
%~dp0\node_modules\.bin\webpack --config %~dp0\webpack.dev.js --progress --colors --watch
|
|
@ -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",
|
|
||||||
};
|
|
|
@ -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",
|
|
||||||
};
|
|
|
@ -4,8 +4,14 @@ const WebpackNotifierPlugin = require("webpack-notifier")
|
||||||
const merge = require('webpack-merge');
|
const merge = require('webpack-merge');
|
||||||
const common = require('./webpack.common.js');
|
const common = require('./webpack.common.js');
|
||||||
|
|
||||||
|
|
||||||
|
const PATHS = {
|
||||||
|
dist: path.join(__dirname, "..", "app", "dist")
|
||||||
|
};
|
||||||
|
|
||||||
module.exports = merge(common, {
|
module.exports = merge(common, {
|
||||||
output: {
|
output: {
|
||||||
|
path: path.join(PATHS.dist, "js"),
|
||||||
pathinfo: true
|
pathinfo: true
|
||||||
},
|
},
|
||||||
cache: true,
|
cache: true,
|
||||||
|
|
Loading…
Add table
Reference in a new issue