Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
electron-webpack
Advanced tools
Configuration and scripts to compile Electron applications that use [electron-vue](https://github.com/SimulatedGREG/electron-vue) boilerplate [project structure](https://simulatedgreg.gitbooks.io/electron-vue/content/en/project_structure.html).
Configuration and scripts to compile Electron applications that use electron-vue boilerplate project structure.
yarn add webpack electron-webpack --dev
Yarn is recommended instead of npm.
But keep things simple. electron-compile offers you zero-config setup without predefined project structure and simple on the fly runtime transformation. And for simple projects, even direct usage of typescript
/babel
maybe enough (example).
So, if you doubt what to use and no suitable boilerplate — use electron-compile. If need, later you can easily migrate to webpack.
To keep your devDependencies
size minimal, only JavaScript is supported out of the box
(because even in a pure typescript project, JavaScript transpilation is required to import external dependencies on demand (e.g. ui libraries iView, Element)).
Special presets are used to ensure that you don't need to specify all required packages explicitly, — for example, electron-webpack-ts
includes ts-loader
and fork-ts-checker-webpack-plugin
for you.
But if you want, you can install loaders/plugins explicitly (it will be still detected and appropriate config applied).
Supported out of the box. Babel plugins and polyfills that you need based on your used version are determined automatically using babel-preset-env.
yarn add typescript electron-webpack-ts --dev
yarn add vue electron-webpack-vue --dev
"Import on demand" feature is supported out of the box.
yarn add less-loader less --dev
You can add following scripts to your package.json
:
{
"scripts": {
"dev": "node node_modules/electron-webpack/dev-runner.js",
"compile": "webpack --bail --env.production --config node_modules/electron-webpack/webpack.app.config.js",
"dist-dir": "yarn compile && electron-builder --dir -c.compression=store -c.mac.identity=null",
"dist": "yarn compile && electron-builder"
}
}
Please see White-listing Externals.
electron-webpack
supports setting this option in the package.json
:
"electronWebpack": {
"whiteListedModules": ["dependency-name"]
}
Set the DEBUG environment variable to debug what electron-webpack is doing:
DEBUG=electron-webpack:*
FAQs
> Because setting up `webpack` in the `electron` environment shouldn't be difficult.
The npm package electron-webpack receives a total of 1,652 weekly downloads. As such, electron-webpack popularity was classified as popular.
We found that electron-webpack demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.