Skip to content

Commit 35f07ac

Browse files
committed
Make builds smaller by running clean and optimizing the builds
1 parent 429cd2d commit 35f07ac

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"dev": "npm-run-all -p watch sandbox",
2424
"format": "prettier --write \"*.{js,jsx,html,mjs,cjs}\" \"{src,test,scripts}/**/*.{js,jsx,html,mjs,cjs}\"",
2525
"lint": "eslint \"*.{js,jsx}\" \"{src,test,scripts}/**/*.{js,jsx}\" --cache --fix",
26-
"package": "npm run build && npx @adobe/reactor-packager",
26+
"package": "npm run clean && NODE_ENV=production npm run build && npx @adobe/reactor-packager@latest",
2727
"precommit-msg": "echo 'Running pre-commit scripts...' && exit 0",
2828
"prepare": "husky install",
2929
"prepush-msg": "echo 'Running pre-push scripts...' && exit 0",

scripts/buildViews.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { watch, inputDir, outputDir } from "./helpers/options.mjs";
1919
const viewEntries = path.join(inputDir, "view/**/*.html");
2020
const viewOutDir = path.join(outputDir, "view");
2121

22-
const isProd = process.env.NODE_ENV === "production";
22+
const isProd = (process.env.NODE_ENV === "production");
2323

2424
const bundler = new Parcel({
2525
entries: viewEntries,
@@ -33,7 +33,7 @@ const bundler = new Parcel({
3333
publicUrl: "../",
3434
distDir: viewOutDir,
3535
sourceMaps: !isProd,
36-
// shouldOptimize: false,
36+
shouldOptimize: isProd,
3737
shouldScopeHoist: false,
3838
},
3939
shouldDisableCache: true,

0 commit comments

Comments
 (0)