diff --git a/gulpfile.js b/gulpfile.js index 5141a2604489be93fc48e9675e6b09e3cf1e3627..f929437c96d7198fd4f8fd848f9f398be5371ef0 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -60,8 +60,8 @@ const args = yargs(hideBin(process.argv)) }) .options('sourcemapsincludecontent', { type: 'boolean', - description: 'Add original js and css code to the source maps', - default: true, + description: 'Add original js and css code to the source maps. Loses file names and paths!', + default: false, }) .options('debug', { type: 'boolean', diff --git a/package.json b/package.json index dbb6f2df718b0a414cad0d7cee9e4102be297bb6..5dd7f88b2b9c5cc6b1ba54539486c20bb80d2a78 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,8 @@ "compile": "sh compile.sh", "build": "npx gulp all", "build:debug": "npx gulp all --debug", - "build:release": "npx gulp all --minify --release" + "build:release": "npx gulp all --minify --release", + "serve": "npx http-server --port 6969 -c-1" }, "license": "GPL-3.0-only", "devDependencies": { @@ -24,6 +25,7 @@ "eslint": "^8.0.0", "eslint-plugin-jsdoc": "^46.0.0", "eslint-plugin-sonarjs": "^0.23.0", + "http-server": "^14.1.1", "ts-essentials": "^9.1.1", "typescript": "^4.4.0" }, diff --git a/serve.bat b/serve.bat new file mode 100644 index 0000000000000000000000000000000000000000..efc80fb5d864cf0aa07af348ab608742dd4f10b1 --- /dev/null +++ b/serve.bat @@ -0,0 +1,28 @@ +@echo off +:: run a Node based web server + +:: Set working directory +pushd %~dp0 +SET BASEDIR=%~dp0 + +:: check for node +where /q node +IF ERRORLEVEL 1 ( + ECHO Node is required to run this http server. + exit /b 0 +) + +:: if the node_modules directory doesn't exist +IF NOT EXIST .\node_modules\ ( + ECHO Node available, but the required Node modules are not installed. + CHOICE /C YN /N /M "Would you like us to run 'npm install' to install Node modules, using ~120 MB of disk space [Y/N]?" + IF !errorlevel!==1 ( + ECHO Installing Node modules... + CALL npm install + ) ELSE ( + ECHO Requirements not met, exiting... + exit /b 0 + ) +) + +CALL npx http-server --port 6969 -c-1 \ No newline at end of file