electron-webpack 使用webpack编译Electron应用程序的脚本和配置

网友投稿 1064 2022-10-25

electron-webpack 使用webpack编译Electron应用程序的脚本和配置

electron-webpack 使用webpack编译Electron应用程序的脚本和配置

Because setting up webpack in the electron environment shouldn't be difficult.

Overview

Modern web development practices today require a lot of setup with things like webpack to bundle your code, babel for transpiling, eslint for linting, and so much more that the list just goes on. Unfortunaly when creating electron applications, all of that setup just became much more difficult. The primary aim of electron-webpack is to eliminate all preliminary setup with one simple install so you can get back to developing your application.

Why create a module and not a full boilerplate?

If you've been in the JavaScript world for even a short period of time, you are very aware that things are always changing, and development setup is no exclusion. Putting all development scripts into a single updatable module just makes sense. Sure a full featured boilerplate works too, but doing also involves needing to manually update those pesky webpack configuration files that some may call magic when something new comes out.

Here are some of the awesome features you'll find using electron-webpack...

Detailed documentationUse of webpack for source code bundlingUse of webpack-dev-server for developmentHMR for both renderer and main processesUse of babel-preset-env that is automatically configured based on your electron versionAdd-ons to support items like TypeScript, Less, EJS, etc.

Quick Start

Get started fast with electron-webpack-quick-start.

# copy template using curlcurl -fsSL https://github.com/electron-userland/electron-webpack-quick-start/archive/master.tar.gz | tar -xz --strip-components 1# or copy template using git clonegit clone https://github.com/electron-userland/electron-webpack-quick-start.gitcd electron-webpack-quick-startrm -rf .git# install dependenciesyarn

If you already have an existing project, or are looking for a custom approach outside of the quick start template, make sure to read over the Core Concepts, Project Structure, and Development sections of electron-webpack's documentaiton.

Next Steps

Make sure to take advantage of the detailed documentation that electron-webpack provides. It covers everything from how things work internally, adding custom configurations, and building your application.

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:好家伙,公司服务器直接热崩掉了!
下一篇:实现web实时消息推送的7种方案
相关文章

 发表评论

暂时没有评论,来抢沙发吧~