http-server-pkg
v1.0.2
Published
Bundle your project with a http-server in a single executable (mac/windows).
Downloads
3
Maintainers
Readme
http-server-pkg
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.
License
Copyright (c) 2023 Florian Walzel, MIT License
Install
npm install http-server-pkg
Build Executable
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).
:clap: Done! :clap:
Motivation
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. :smirk: 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.
The Executables
For your build options see PKG Targets.
See the Gist
Running a Vue.js App as a Stand-alone Executable (Mac / Windows)