diff --git a/package-lock.json b/package-lock.json index 546883e..20c1d4c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,7 +19,6 @@ }, "devDependencies": { "@custom-elements-manifest/analyzer": "^0.6.3", - "@kooneko/livereload-webpack-plugin": "^1.2.1", "@pega/configs": "^0.14.0", "@pega/constellationjs": "~24.2.0", "@pega/pcore-pconnect-typedefs": "~3.2.1", @@ -27,7 +26,6 @@ "@types/debug": "^4.1.12", "@types/json-schema": "^7.0.15", "@types/ms": "^0.7.34", - "clean-webpack-plugin": "^4.0.0", "compression-webpack-plugin": "^11.1.0", "copy-webpack-plugin": "^12.0.2", "css-loader": "^7.1.2", @@ -1297,124 +1295,6 @@ "tslib": "2" } }, - "node_modules/@kooneko/livereload-webpack-plugin": { - "version": "1.2.1", - "dev": true, - "license": "ISC", - "dependencies": { - "anymatch": "^3.1.1", - "get-port": "^5.1.1", - "tiny-lr": "^2.0.0", - "webpack": "^5.15.0", - "webpack-cli": "^4.3.1" - } - }, - "node_modules/@kooneko/livereload-webpack-plugin/node_modules/@webpack-cli/configtest": { - "version": "1.2.0", - "dev": true, - "license": "MIT", - "peerDependencies": { - "webpack": "4.x.x || 5.x.x", - "webpack-cli": "4.x.x" - } - }, - "node_modules/@kooneko/livereload-webpack-plugin/node_modules/@webpack-cli/info": { - "version": "1.5.0", - "dev": true, - "license": "MIT", - "dependencies": { - "envinfo": "^7.7.3" - }, - "peerDependencies": { - "webpack-cli": "4.x.x" - } - }, - "node_modules/@kooneko/livereload-webpack-plugin/node_modules/@webpack-cli/serve": { - "version": "1.7.0", - "dev": true, - "license": "MIT", - "peerDependencies": { - "webpack-cli": "4.x.x" - }, - "peerDependenciesMeta": { - "webpack-dev-server": { - "optional": true - } - } - }, - "node_modules/@kooneko/livereload-webpack-plugin/node_modules/commander": { - "version": "7.2.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 10" - } - }, - "node_modules/@kooneko/livereload-webpack-plugin/node_modules/interpret": { - "version": "2.2.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/@kooneko/livereload-webpack-plugin/node_modules/rechoir": { - "version": "0.7.1", - "dev": true, - "license": "MIT", - "dependencies": { - "resolve": "^1.9.0" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/@kooneko/livereload-webpack-plugin/node_modules/webpack-cli": { - "version": "4.10.0", - "dev": true, - "license": "MIT", - "dependencies": { - "@discoveryjs/json-ext": "^0.5.0", - "@webpack-cli/configtest": "^1.2.0", - "@webpack-cli/info": "^1.5.0", - "@webpack-cli/serve": "^1.7.0", - "colorette": "^2.0.14", - "commander": "^7.0.0", - "cross-spawn": "^7.0.3", - "fastest-levenshtein": "^1.0.12", - "import-local": "^3.0.2", - "interpret": "^2.2.0", - "rechoir": "^0.7.0", - "webpack-merge": "^5.7.3" - }, - "bin": { - "webpack-cli": "bin/cli.js" - }, - "engines": { - "node": ">=10.13.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - }, - "peerDependencies": { - "webpack": "4.x.x || 5.x.x" - }, - "peerDependenciesMeta": { - "@webpack-cli/generators": { - "optional": true - }, - "@webpack-cli/migrate": { - "optional": true - }, - "webpack-bundle-analyzer": { - "optional": true - }, - "webpack-dev-server": { - "optional": true - } - } - }, "node_modules/@leichtgewicht/ip-codec": { "version": "2.0.5", "dev": true, @@ -1788,15 +1668,6 @@ "@types/send": "*" } }, - "node_modules/@types/glob": { - "version": "7.2.0", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/minimatch": "*", - "@types/node": "*" - } - }, "node_modules/@types/html-minifier-terser": { "version": "6.1.0", "dev": true, @@ -1830,11 +1701,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@types/minimatch": { - "version": "5.1.2", - "dev": true, - "license": "MIT" - }, "node_modules/@types/ms": { "version": "0.7.34", "dev": true, @@ -2702,14 +2568,6 @@ "node": ">=8" } }, - "node_modules/array-uniq": { - "version": "1.0.3", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/array.prototype.findlast": { "version": "1.2.5", "dev": true, @@ -2926,16 +2784,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/body": { - "version": "5.1.0", - "dev": true, - "dependencies": { - "continuable-cache": "^0.3.1", - "error": "^7.0.0", - "raw-body": "~1.1.0", - "safe-json-parse": "~1.0.1" - } - }, "node_modules/body-parser": { "version": "1.20.3", "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", @@ -3083,10 +2931,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/bytes": { - "version": "1.0.0", - "dev": true - }, "node_modules/call-bind": { "version": "1.0.7", "dev": true, @@ -3229,20 +3073,6 @@ "node": ">= 10.0" } }, - "node_modules/clean-webpack-plugin": { - "version": "4.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "del": "^4.1.1" - }, - "engines": { - "node": ">=10.0.0" - }, - "peerDependencies": { - "webpack": ">=4.0.0 <6.0.0" - } - }, "node_modules/clear-module": { "version": "4.1.2", "dev": true, @@ -3521,10 +3351,6 @@ "node": ">= 0.6" } }, - "node_modules/continuable-cache": { - "version": "0.3.1", - "dev": true - }, "node_modules/conventional-changelog-angular": { "version": "7.0.0", "dev": true, @@ -4233,57 +4059,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/del": { - "version": "4.1.1", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/glob": "^7.1.1", - "globby": "^6.1.0", - "is-path-cwd": "^2.0.0", - "is-path-in-cwd": "^2.0.0", - "p-map": "^2.0.0", - "pify": "^4.0.1", - "rimraf": "^2.6.3" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/del/node_modules/array-union": { - "version": "1.0.2", - "dev": true, - "license": "MIT", - "dependencies": { - "array-uniq": "^1.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/del/node_modules/globby": { - "version": "6.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "array-union": "^1.0.1", - "glob": "^7.0.3", - "object-assign": "^4.0.1", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/del/node_modules/globby/node_modules/pify": { - "version": "2.3.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/depd": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", @@ -4514,13 +4289,6 @@ "node": ">=4" } }, - "node_modules/error": { - "version": "7.2.1", - "dev": true, - "dependencies": { - "string-template": "~0.2.1" - } - }, "node_modules/error-ex": { "version": "1.3.2", "dev": true, @@ -6334,17 +6102,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/get-port": { - "version": "5.1.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/get-stdin": { "version": "9.0.0", "dev": true, @@ -7471,36 +7228,6 @@ "node": ">=8" } }, - "node_modules/is-path-cwd": { - "version": "2.2.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/is-path-in-cwd": { - "version": "2.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "is-path-inside": "^2.1.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/is-path-in-cwd/node_modules/is-path-inside": { - "version": "2.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "path-is-inside": "^1.0.2" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/is-path-inside": { "version": "3.0.3", "dev": true, @@ -8008,11 +7735,6 @@ "@types/trusted-types": "^2.0.2" } }, - "node_modules/livereload-js": { - "version": "3.4.1", - "dev": true, - "license": "MIT" - }, "node_modules/load-json-file": { "version": "4.0.0", "dev": true, @@ -8911,14 +8633,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/p-map": { - "version": "2.1.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, "node_modules/p-retry": { "version": "6.2.0", "dev": true, @@ -9021,11 +8735,6 @@ "node": ">=0.10.0" } }, - "node_modules/path-is-inside": { - "version": "1.0.2", - "dev": true, - "license": "(WTFPL OR MIT)" - }, "node_modules/path-key": { "version": "3.1.1", "dev": true, @@ -9080,33 +8789,6 @@ "node": ">=0.10" } }, - "node_modules/pify": { - "version": "4.0.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/pinkie": { - "version": "2.0.4", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/pinkie-promise": { - "version": "2.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "pinkie": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/pkg-dir": { "version": "4.2.0", "dev": true, @@ -9508,18 +9190,6 @@ "node": ">= 0.6" } }, - "node_modules/raw-body": { - "version": "1.1.7", - "dev": true, - "license": "MIT", - "dependencies": { - "bytes": "1", - "string_decoder": "0.10" - }, - "engines": { - "node": ">= 0.8.0" - } - }, "node_modules/react-is": { "version": "16.13.1", "dev": true, @@ -9868,17 +9538,6 @@ "node": ">=0.10.0" } }, - "node_modules/rimraf": { - "version": "2.7.1", - "dev": true, - "license": "ISC", - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - } - }, "node_modules/rimraf-standalone": { "version": "2.6.1-7", "dev": true, @@ -9942,10 +9601,6 @@ "dev": true, "license": "MIT" }, - "node_modules/safe-json-parse": { - "version": "1.0.1", - "dev": true - }, "node_modules/safe-regex-test": { "version": "1.0.3", "dev": true, @@ -10521,15 +10176,6 @@ "node": ">= 0.4" } }, - "node_modules/string_decoder": { - "version": "0.10.31", - "dev": true, - "license": "MIT" - }, - "node_modules/string-template": { - "version": "0.2.1", - "dev": true - }, "node_modules/string-width": { "version": "4.2.3", "dev": true, @@ -11068,27 +10714,6 @@ "dev": true, "license": "MIT" }, - "node_modules/tiny-lr": { - "version": "2.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "body": "^5.1.0", - "debug": "^3.1.0", - "faye-websocket": "^0.11.3", - "livereload-js": "^3.3.1", - "object-assign": "^4.1.0", - "qs": "^6.4.0" - } - }, - "node_modules/tiny-lr/node_modules/debug": { - "version": "3.2.7", - "dev": true, - "license": "MIT", - "dependencies": { - "ms": "^2.1.1" - } - }, "node_modules/to-regex-range": { "version": "5.0.1", "dev": true, diff --git a/package.json b/package.json index 563f7e4..85ed9e4 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,6 @@ }, "devDependencies": { "@custom-elements-manifest/analyzer": "^0.6.3", - "@kooneko/livereload-webpack-plugin": "^1.2.1", "@pega/configs": "^0.14.0", "@pega/constellationjs": "~24.2.0", "@pega/pcore-pconnect-typedefs": "~3.2.1", @@ -50,7 +49,6 @@ "@types/debug": "^4.1.12", "@types/json-schema": "^7.0.15", "@types/ms": "^0.7.34", - "clean-webpack-plugin": "^4.0.0", "compression-webpack-plugin": "^11.1.0", "copy-webpack-plugin": "^12.0.2", "css-loader": "^7.1.2", diff --git a/webpack.config.js b/webpack.config.js index 8020d6a..8244141 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,9 +1,7 @@ /* eslint-disable strict */ const path = require('path'); const HtmlWebpackPlugin = require('html-webpack-plugin'); -const { CleanWebpackPlugin } = require('clean-webpack-plugin'); const CopyWebpackPlugin = require('copy-webpack-plugin'); -const LiveReloadPlugin = require('@kooneko/livereload-webpack-plugin'); const CompressionPlugin = require('compression-webpack-plugin'); const zlib = require('zlib'); @@ -11,13 +9,6 @@ module.exports = (env, argv) => { const pluginsToAdd = []; const mode = argv.mode; - pluginsToAdd.push( - new CleanWebpackPlugin({ - dry: true, - verbose: false, - dangerouslyAllowCleanPatternsOutsideProject: true - }) - ); pluginsToAdd.push( new HtmlWebpackPlugin({ template: './src/index.html', @@ -47,16 +38,9 @@ module.exports = (env, argv) => { from: './node_modules/@pega/auth/lib/oauth-client/authDone.js', to: './' }, - // { - // from: './node_modules/@pega/constellationjs/dist/bootstrap-shell.js', - // to: './constellation' - // }, { from: './node_modules/@pega/constellationjs/dist/bootstrap-shell*', to: './constellation/[name][ext]' - // to() { - // return Promise.resolve('constellation/[name][ext]'); - // } }, { from: './node_modules/@pega/constellationjs/dist/lib_asset.json', @@ -65,17 +49,10 @@ module.exports = (env, argv) => { { from: './node_modules/@pega/constellationjs/dist/constellation-core*', to: './constellation/prerequisite/[name][ext]' - // to() { - // return Promise.resolve('constellation/prerequisite'); - // // return Promise.resolve('constellation/prerequisite/[name].[ext]'); - // } }, { from: './assets/icons/*', to: './constellation/icons/[name][ext]' - // to() { - // return Promise.resolve('constellation/icons/[name][ext]'); - // } }, { from: './node_modules/@pega/constellationjs/dist/js', @@ -86,8 +63,8 @@ module.exports = (env, argv) => { ); // Enable gzip and brotli compression - // Exclude constellation-core and bootstrap-shell files since - // client receives these files in gzip and brotli format + // Exclude constellation-core and bootstrap-shell files since + // client receives these files in gzip and brotli format if (mode === 'production') { pluginsToAdd.push( new CompressionPlugin({ @@ -116,23 +93,10 @@ module.exports = (env, argv) => { ); } - if (mode === 'development') { - // In development mode, add LiveReload plug - // When run in conjunction with build-with-watch, - // This will reload the browser when code is changed/re-compiled - const liveReloadOptions = { - protocol: 'http', - appendScriptTag: true, - delay: 1000, - hostname: 'localhost' - }; - pluginsToAdd.push(new LiveReloadPlugin(liveReloadOptions)); - } - // need to set mode to 'development' to get LiveReload to work - // and for debugger statements to not be stripped out of the bundle + // and for debugger statements to not be stripped out of the bundle return { - mode: argv.mode, + mode, entry: { app: './src/index.ts' }, @@ -143,12 +107,13 @@ module.exports = (env, argv) => { port: 3501, open: false }, - devtool: 'inline-source-map', - // devtool: argv.mode === 'production' ? false : 'inline-source-map', + devtool: mode === 'production' ? false : 'inline-source-map', plugins: pluginsToAdd, output: { filename: '[name].bundle.js', - path: path.resolve(__dirname, 'dist') + path: path.resolve(__dirname, 'dist'), + publicPath: '/', + clean: true }, module: { rules: [