Эх сурвалжийг харах

Improving watch & build scripts

Jason Tarka 4 жил өмнө
parent
commit
9be5876306

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 724 - 9
web-view/package-lock.json


+ 13 - 1
web-view/package.json

@@ -6,7 +6,18 @@
   "scripts": {
   "scripts": {
     "test": "ts-mocha src/**/*.test.ts",
     "test": "ts-mocha src/**/*.test.ts",
     "clean": "rm -rf build",
     "clean": "rm -rf build",
-    "build": "webpack --mode=development"
+    "build": "npm run clean && npm run build:js && npm run build:html",
+    "build:html": "cp -r ./src/*.html ./build",
+    "build:js": "webpack --mode=production",
+    "watch:js": "webpack --mode=development --watch",
+    "watch:html": "npm-watch"
+  },
+  "watch": {
+    "build:html": {
+      "patterns": ["src"],
+      "extensions": "html",
+      "runOnChangeOnly": false
+    }
   },
   },
   "keywords": [],
   "keywords": [],
   "author": "Jason Tarka <git@tarka.ca>",
   "author": "Jason Tarka <git@tarka.ca>",
@@ -21,6 +32,7 @@
     "@types/mocha": "^9.0.0",
     "@types/mocha": "^9.0.0",
     "@types/should": "^13.0.0",
     "@types/should": "^13.0.0",
     "mocha": "^8.4.0",
     "mocha": "^8.4.0",
+    "npm-watch": "^0.11.0",
     "should": "^13.2.3",
     "should": "^13.2.3",
     "ts-loader": "^9.2.6",
     "ts-loader": "^9.2.6",
     "ts-mocha": "^8.0.0",
     "ts-mocha": "^8.0.0",

+ 0 - 1
web-view/webpack.config.js

@@ -3,7 +3,6 @@ const path = require('path');
 module.exports = {
 module.exports = {
 	// The entry point
 	// The entry point
 	entry: './src/js/main.ts',
 	entry: './src/js/main.ts',
-	watch: true,
 
 
 	module: {
 	module: {
 		rules: [
 		rules: [

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно