Bundle your project together with a http-server in a single executable (macOS / Windows / Linux).
Build a simple double click executable that will start a web server, open Google Chrome, and run your project.
Copyright (c) 2023 Florian Walzel, MIT License
npm install http-server-pkg
Replace the ./dist
folder with your project folder. (If your folder name is not dist
, you need to change this
configuration in the package.js "assets": "dist/**/*",
and Line 19 in pkg.js root: path.join(__dirname, 'dist');
).
Now build your executables:
pkg .
Your executable files (Mac/ Win) will be build to the folder ./executable
, according to the specs given in the package.json.
(This is what the dot '.' argument after the pkg command means: use the configuration as defined in the package.json).
👏 Done! 👏
Some projects or frameworks need a web server in order to run. For local deployment, presentation or testing this can become a problem, i.e. when third parties are involved (clients, collaborators, …). Explaining someone with no technical background how to install Node.js and run a local web server just to see our project is very inconvenient. 😏 To solve this, http-server-pkg creates an executable package that contains a web server alongside with your project. A simple double click on the executable will start the web server, open Google Chrome, and run your project.
For your build options see PKG Targets.
Running a Vue.js App as a Stand-alone Executable (Mac / Windows)