From b4f8eeb820f98945b0f75dfb0b0f10e95eab7b15 Mon Sep 17 00:00:00 2001 From: pbarbiero Date: Fri, 24 Feb 2017 11:49:49 -0600 Subject: [PATCH] 0.2.0 --- .gitignore | 1 + README.md | 6 +++--- package.json | 6 ++++-- webpack.build.config.js | 4 ++-- webpack.dev.config.js | 5 ----- 5 files changed, 10 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index a03ce45e..3bf73a1b 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ node_modules/ *.DS_Store dist/bundle.js dist/bundle.css +builds/ diff --git a/README.md b/README.md index 1e821469..6b106860 100644 --- a/README.md +++ b/README.md @@ -20,11 +20,11 @@ If you like this project, check out _enhanced-electron-react-boilerplate_ which _You have two options, an automatic build or two manual steps_ ###### One Shot -* Run `npm run package` to have webpack compile your application into `dist/bundle.js` and `dist/index.html`, and then an electron-packager run will be triggered for the current platform/arch using asar archives -* _Not yet available_ +* Run `npm run package` to have webpack compile your application into `dist/bundle.js` and `dist/index.html`, and then an electron-packager run will be triggered for the current platform/arch, outputting to `builds/` ###### Manual +_Recommendation: Update the "postpackage" script call in package.json to specify parameters as you choose and use the `npm run package` command instead of running these steps manually_ * Run `npm run build` to have webpack compile and output your bundle to `dist/bundle.js` * Then you can call electron-packager directly with any commands you choose -If you want to test the production build (In case you think Babili might be breaking something) after running `npm run build` you can then call `npm run testProd` +If you want to test the production build (In case you think Babili might be breaking something) after running `npm run build` you can then call `npm run testProd`. This will cause electron to load off of the `dist/` build instead of looking for the webpack-dev-server instance. diff --git a/package.json b/package.json index 80b1bda7..dc4e3516 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "basic-electron-react-boilerplate", - "version": "0.1.0", + "version": "0.2.0", "description": "Minimal and modern react+electron+webpack boilerplate", "author": "Phillip Barbiero", "homepage": "https://github.com/PhillMcKraken/basic-electron-react-boilerplate", @@ -15,7 +15,8 @@ "testProd": "electron main.js --noDevServer", "dev": "webpack-dev-server --hot --host 0.0.0.0 --config=./webpack.dev.config.js", "build": "webpack --config webpack.build.config.js", - "package": "webpack --config webpack.build.config.js" + "package": "webpack --config webpack.build.config.js", + "postpackage": "electron-packager ./ --out=./builds" }, "devDependencies": { "babel-core": "^6.23.1", @@ -25,6 +26,7 @@ "babili-webpack-plugin": "0.0.10", "css-loader": "^0.26.1", "electron": "^1.4.15", + "electron-packager": "^8.5.2", "extract-text-webpack-plugin": "^2.0.0-rc.3", "html-webpack-plugin": "^2.28.0", "react": "^15.4.2", diff --git a/webpack.build.config.js b/webpack.build.config.js index 1845f60a..70ff2c90 100644 --- a/webpack.build.config.js +++ b/webpack.build.config.js @@ -32,8 +32,8 @@ module.exports = { new ExtractTextPlugin("bundle.css"), new webpack.DefinePlugin({ 'process.env.NODE_ENV': '"production"', - })/*, - new BabiliPlugin()*/ + }), + new BabiliPlugin() ], stats: { colors: true, diff --git a/webpack.dev.config.js b/webpack.dev.config.js index 10393835..616c6b60 100644 --- a/webpack.dev.config.js +++ b/webpack.dev.config.js @@ -22,11 +22,6 @@ module.exports = { { loader: 'style-loader' }, { loader: 'css-loader' } ], include: defaultInclude }, - /*{ test: /\.less$/, use: [ - { loader: 'style-loader' }, - { loader: 'css-loader' }, - { loader: 'less-loader' } - ], include: defaultInclude },*/ { test: /\.js?$/, use: [ { loader: 'babel-loader' } ], include: defaultInclude }