From: xangelo Date: Wed, 25 Jan 2023 14:54:34 +0000 (-0500) Subject: update build params X-Git-Url: https://git.xangelo.ca/?p=apps%2Foutliner%2F.git;a=commitdiff_plain;h=e20ff128a5e56d34c7752f9b5add3936dd6e871f update build params - Allow environment selection for prod deploys without sourcemaps - Ignore any .txt files included with the source --- diff --git a/.gitignore b/.gitignore index c2658d7..e1bbff4 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ node_modules/ +*.txt diff --git a/package.json b/package.json index 47b95a2..24fb924 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "outline-browser", "scripts": { "dev": "npx webpack -w", - "build": "npx webpack" + "build": "ENVIRONMENT=production npx webpack" }, "devDependencies": { "@types/keyboardjs": "^2.5.0", @@ -21,5 +21,9 @@ "lodash": "^4.17.21", "marked": "^4.2.12", "uuid": "^9.0.0" + }, + "volta": { + "node": "18.7.0", + "npm": "8.15.0" } } diff --git a/webpack.config.js b/webpack.config.js index 234e08f..ea66bb8 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -2,9 +2,11 @@ const path = require('path'); const tsconfigPaths = require('tsconfig-paths-webpack-plugin'); +const env = process.env.ENVIRONMENT || 'development'; + module.exports = { - mode: "development", - devtool: "inline-source-map", + mode: env, + devtool: env === 'environment' ? "inline-source-map" : false, entry: { main: "./src/client.ts", },