Minimal Electron, Express, React and Webpack boilerplate to help you get started with building your next app.
This project was a fork of electron-react-webpack-boilerplate. I keep some files used in that project, but I add and change things.
In this project I add ExpressJs, removed PostCSS, added Sass and added Electron Builder to create the app package.
git clone git@github.com:WalterRadduso/electron-express-react-boilerplate.git
yarn
or
npm install
Copy the example environment variable.
cp .env.example .env
Now you are able to change the port.
yarn start-all
or
npm run start-all
yarn prod
or
npm run prod
yarn build
or
npm run build
This boilerplate uses HTML Webpack Plugin to generate the HTML file of the app. Changing app title is possible only through webpack configs, webpack.build.config.js
and webpack.dev.config.js
. App title can be changed by adding objects of options.
In webpack.build.config.js
:
plugins: [
new HtmlWebpackPlugin({title: 'New app title'}),// Add this (line 41)
new MiniCssExtractPlugin({
// Options similar to the same options in webpackOptions.output
// both options are optional
filename: 'bundle.css',
chunkFilename: '[id].css'
}),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('production')
}),
new BabiliPlugin()
]
In webpack.dev.config.js
:
plugins: [
new HtmlWebpackPlugin({title: 'New app title '}),// Add this (line 36)
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('development')
})
]
You are able to add the files/folders that you need in your package.
In package.json
you have to add/remove the files that you need in your own project.
{
"build": {
"files": [
"dist",
"electron.js",
"node_modules",
"package.json",
"server.js",
"src",
"splash"
]
}
}
yarn package-mac
or
npm run package-mac
yarn package-win
or
npm run package-win
yarn package-linux
or
npm run package-linux
I want your feedback! Here's a list of different ways to me and request help:
- Report bugs and submit feature requests to GitHub issues.
If you feel generous and want to show some extra appreciation:
MIT © Walter Radduso.