chore: tweak size script
This commit is contained in:
parent
3ddd121b19
commit
30e60c0492
@ -6,7 +6,7 @@
|
||||
"scripts": {
|
||||
"dev": "node scripts/dev.js",
|
||||
"build": "node scripts/build.js",
|
||||
"size": "node scripts/build.js runtime-dom -f esm-browser",
|
||||
"size": "node scripts/build.js runtime-dom -p -f esm-browser && node scripts/build.js compiler-dom -p -f esm-browser",
|
||||
"lint": "prettier --write --parser typescript 'packages/**/*.ts'",
|
||||
"test": "jest"
|
||||
},
|
||||
|
@ -53,9 +53,9 @@ const configs = {
|
||||
const defaultFormats = ['esm', 'cjs']
|
||||
const inlineFromats = process.env.FORMATS && process.env.FORMATS.split(',')
|
||||
const packageFormats = inlineFromats || packageOptions.formats || defaultFormats
|
||||
const packageConfigs = packageFormats.map(format =>
|
||||
createConfig(configs[format])
|
||||
)
|
||||
const packageConfigs = process.env.PROD_ONLY
|
||||
? []
|
||||
: packageFormats.map(format => createConfig(configs[format]))
|
||||
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
packageFormats.forEach(format => {
|
||||
|
@ -55,7 +55,8 @@ async function build(target) {
|
||||
`NODE_ENV:production,` +
|
||||
`TARGET:${target}` +
|
||||
(formats ? `,FORMATS:${formats}` : ``) +
|
||||
(args.types ? `,TYPES:true` : ``)
|
||||
(args.types ? `,TYPES:true` : ``) +
|
||||
(args.p ? `,PROD_ONLY:true` : ``)
|
||||
],
|
||||
{ stdio: 'inherit' }
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user