add build:ci script

This commit is contained in:
Philipp Kühn
2020-11-10 15:16:38 +01:00
parent 0ac228156c
commit 960368db0e
2 changed files with 25 additions and 21 deletions

View File

@@ -14,6 +14,7 @@
"start": "yarn --cwd ./docs start", "start": "yarn --cwd ./docs start",
"build:docs": "yarn --cwd ./docs build", "build:docs": "yarn --cwd ./docs build",
"build:packages": "yarn clean:packages && rollup -c", "build:packages": "yarn clean:packages && rollup -c",
"build:ci": "yarn clean:packages && rollup -c --ci",
"clean:packages": "rm -rf ./packages/*/dist", "clean:packages": "rm -rf ./packages/*/dist",
"lint": "eslint --quiet --no-error-on-unmatched-pattern ./", "lint": "eslint --quiet --no-error-on-unmatched-pattern ./",
"test:open": "cypress open --project tests", "test:open": "cypress open --project tests",

View File

@@ -24,10 +24,11 @@ async function build(commandLineArgs) {
const config = [] const config = []
// Support --scope and --ignore globs if passed in via commandline // Support --scope and --ignore globs if passed in via commandline
const { scope, ignore } = minimist(process.argv.slice(2)) const { scope, ignore, ci } = minimist(process.argv.slice(2))
const packages = await getSortedPackages(scope, ignore) const packages = await getSortedPackages(scope, ignore)
// prevent rollup warning // prevent rollup warning
delete commandLineArgs.ci
delete commandLineArgs.scope delete commandLineArgs.scope
delete commandLineArgs.ignore delete commandLineArgs.ignore
@@ -90,27 +91,29 @@ async function build(commandLineArgs) {
plugins, plugins,
}) })
config.push({ if (!ci) {
input, config.push({
output: [ input,
{ output: [
name, {
file: path.join(basePath, unpkg), name,
format: 'umd', file: path.join(basePath, unpkg),
sourcemap: true, format: 'umd',
globals: { sourcemap: true,
vue: 'Vue', globals: {
vue: 'Vue',
},
}, },
}, ],
], external: [
externals: [ 'vue',
'vue', ],
], plugins: [
plugins: [ ...plugins,
...plugins, terser(),
terser(), ],
], })
}) }
}) })
return config return config