From 960368db0e4d2452dcf48983d6a33f1fbc219405 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Ku=CC=88hn?= Date: Tue, 10 Nov 2020 15:16:38 +0100 Subject: [PATCH] add build:ci script --- package.json | 1 + rollup.config.js | 45 ++++++++++++++++++++++++--------------------- 2 files changed, 25 insertions(+), 21 deletions(-) diff --git a/package.json b/package.json index 150f26aa..0fbca9f9 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "start": "yarn --cwd ./docs start", "build:docs": "yarn --cwd ./docs build", "build:packages": "yarn clean:packages && rollup -c", + "build:ci": "yarn clean:packages && rollup -c --ci", "clean:packages": "rm -rf ./packages/*/dist", "lint": "eslint --quiet --no-error-on-unmatched-pattern ./", "test:open": "cypress open --project tests", diff --git a/rollup.config.js b/rollup.config.js index 43d2227d..99edcae1 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -24,10 +24,11 @@ async function build(commandLineArgs) { const config = [] // 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) // prevent rollup warning + delete commandLineArgs.ci delete commandLineArgs.scope delete commandLineArgs.ignore @@ -90,27 +91,29 @@ async function build(commandLineArgs) { plugins, }) - config.push({ - input, - output: [ - { - name, - file: path.join(basePath, unpkg), - format: 'umd', - sourcemap: true, - globals: { - vue: 'Vue', + if (!ci) { + config.push({ + input, + output: [ + { + name, + file: path.join(basePath, unpkg), + format: 'umd', + sourcemap: true, + globals: { + vue: 'Vue', + }, }, - }, - ], - externals: [ - 'vue', - ], - plugins: [ - ...plugins, - terser(), - ], - }) + ], + external: [ + 'vue', + ], + plugins: [ + ...plugins, + terser(), + ], + }) + } }) return config