diff --git a/package.json b/package.json index 28d963c..5085142 100644 --- a/package.json +++ b/package.json @@ -6,9 +6,11 @@ "scripts": { "test": "jest --coverage", "utiltest": "mocha -r ts-node/register __tests__/mochatest/libraryUtilitiesTest.ts --reporter mocha-junit-reporter --reporter-options mochaFile=./TestResults/MochaReport.xml", - "build": "npm run prod", "dev": "cross-env NODE_ENV=development webpack", - "prod": "cross-env NODE_ENV=production webpack", + "build": "cross-env NODE_ENV=production --mode=development webpack", + "bundle": "cross-env NODE_ENV=production --mode=production webpack", + "copy": "cp package.json dist/ && cp README.md dist/ && cp -r license_output dist/", + "prod": "npm run bundle && npm run copy", "serve": "npm run dev & node ./index.js", "lic_direct": "npx @adsk/adsk-npm-license-puller --path . --app-name 'librarieJS' --verbose --about-box ./license_output/about-box_direct.html --about-box-type desktop --year 2022 --paos ./license_output/paos_direct.csv", "lic_transitive": "npx @adsk/adsk-npm-license-puller --path . --app-name 'librarieJS' --verbose --about-box ./license_output/about-box_transitive.html --about-box-type desktop --transitive --year 2022 --paos ./license_output/paos_transitive.csv", diff --git a/webpack.config.js b/webpack.config.js index fb05e41..9db3293 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,17 +1,14 @@ "use strict"; const webpack = require('webpack'); const TerserPlugin = require("terser-webpack-plugin"); -const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; const path = require('path'); -let productionBuild = (process.env.NODE_ENV == "production"); +const productionBuild = (process.env.NODE_ENV == "production"); let plugins = []; plugins.push( new webpack.DefinePlugin({ 'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV), }), - //uncomment to analyze what is bundled. - //new BundleAnalyzerPlugin(), );