Minify JS built for production

This feels a bit weird on the idioms but ehh I think it's fine… mostly just, the `assets:precompile` task is gonna call `yarn build` here, so `yarn build` needs to be production settings; but also we want not quite all those settings on in development, so there's a base task that both the prod `build` and `dev` call.
This commit is contained in:
Emi Matchu 2023-08-22 15:06:15 -07:00
parent 307f559226
commit d028c6854a

View file

@ -27,7 +27,8 @@
"tweenjs": "^1.0.2" "tweenjs": "^1.0.2"
}, },
"scripts": { "scripts": {
"build": "esbuild app/javascript/*.* --bundle --sourcemap --outdir=app/assets/builds --public-path=/assets --loader:.js=jsx --loader:.png=file --loader:.svg=file --loader:.min.js=text", "build": "yarn build:base --minify",
"build:production": "yarn build --minify" "build:base": "esbuild app/javascript/*.* --bundle --sourcemap --outdir=app/assets/builds --public-path=/assets --loader:.js=jsx --loader:.png=file --loader:.svg=file --loader:.min.js=text",
"dev": "yarn build:base --watch"
} }
} }