Minimal Electron, React, PostCSS and Webpack boilerplate to help you get started with building your next app.
git clone https://github.com/alexdevero/electron-react-webpack-boilerplate.git
npm install
or
yarn
npm run start
or
yarn start
npm run package
or
yarn package
npm run build
or
yarn build
npm run build
|| yarn run build
)npm run prod
yarn prod
Adding Sass to boilerplate requires updating webpack configs and adding necessary loaders.
webpack.build.config.js
and webpack.dev.config.js
add new object to rules
:{
test: /\.scss$/,
use: [
{ loader: 'style-loader' },
{ loader: 'css-loader' },
{ loader: 'sass-loader' }],
include: defaultInclude
}
Install additional loaders for sass, sass-loader
and node-sass
.
Rename all CSS file to .scss
.
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')
})
],
I want your feedback! Here's a list of different ways to me and request help:
If you feel generous and want to show some extra appreciation:
Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
MIT © Alex Devero.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。