update build params
authorxangelo <git@xangelo.ca>
Wed, 25 Jan 2023 14:54:34 +0000 (09:54 -0500)
committerxangelo <git@xangelo.ca>
Wed, 25 Jan 2023 14:54:34 +0000 (09:54 -0500)
- Allow environment selection for prod deploys without sourcemaps
- Ignore any .txt files included with the source

.gitignore
package.json
webpack.config.js

index c2658d7d1b31848c3b71960543cb0368e56cd4c7..e1bbff4290a425316d5066e5514959e6f82e5b1d 100644 (file)
@@ -1 +1,2 @@
 node_modules/
+*.txt
index 47b95a2688195d07fea2f60ac04234f443890926..24fb9244a6d9bae01c2fb1c291d6754e269ea547 100644 (file)
@@ -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"
   }
 }
index 234e08ff20c851bdf1b8f256ac63d84a49035dcb..ea66bb898a95f76dc86bafb9e3ade43f49f01435 100644 (file)
@@ -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",
   },