How to run webpack server
I had to do it programmatically using the module and manually start the serve process where I could run electron once the webpack dev server was started. At the root of project folder, create file. I'll be using yarn throughout this article. yarn add webpack webpack-cli webpack-dev-server -dev yarn add html-webpack-plugin -dev. This is how I ended up doing it and managed to create a build tool called Vuelectro. Add webpack and its relevant packages to your project. (I also know that this feature is already implemented in vue-cli-plugin-electron-builder but I’m avoiding all these plugins for multiple reasons) Answer So what I want is to automatically run cross-env NODE_ENV=development electron dist/main.js after I run serve Vue task and the dev server has been started. I found out that It’s possible to open a browser after the server has started. but when I run npm build for package project. It only seems to work over the dev server ( Issue seems to be file:// protocol). When use bootstrap in react project, run dev environment work fine. Vue devtools won’t work even if I set writeToDisk: true and open up the index.html on Electron. My only purpose for this is to get Vue devtools running on Electron.
I know I can manually run Electron after this but I need this task to be automated. Since Vue uses webpack dev server to run the Vue app in development mode, I need to launch Electron with the dev server URL right after compilation completes and dev server has been started. I’m doing a Vue project that runs on Electron. The question is published on Januby Tutorial Guruji team. There are 10694 other projects in the npm registry using webpack-dev-server. Start using webpack-dev-server in your project by running npm i webpack-dev-server. devServer.allowedHosts 'auto' 'all' string This option allows you to whitelist services that are allowed to access the dev server.
See the related API documentation for webpack-dev-server. Today at Tutorial Guruji Official website, we are sharing the answer of How do I automatically run an NPM script after webpack dev server has been started? without wasting too much if your time. Latest version: 4.7.4, last published: a month ago. While it's recommended to run webpack-dev-server via the CLI, you may also choose to start a server via the API. Hello Developer, Hope you guys are doing great.