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:
Jeremy Kauffman 2017-11-10 08:27:29 -05:00 committed by GitHub
commit 4c94f65493
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 128 deletions

View file

@ -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/"
)

View file

@ -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
%~dp0\node_modules\.bin\webpack --config %~dp0\webpack.dev.js --progress --colors --watch

View file

@ -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",
};

View file

@ -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",
};

View file

@ -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,