Skip to content
This repository was archived by the owner on Jan 18, 2025. It is now read-only.

Commit 75091ef

Browse files
author
Ernest
committed
build: migrate to rollup-plugin-copy
1 parent 3cb79cb commit 75091ef

File tree

3 files changed

+51
-82
lines changed

3 files changed

+51
-82
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
"prettier": "^2.0.5",
6666
"rimraf": "^5.0.0",
6767
"rollup": "^3.0.0",
68-
"rollup-plugin-copy-watch": "^0.0.1",
68+
"rollup-plugin-copy": "^3.5.0",
6969
"rollup-plugin-node-globals": "^1.4.0",
7070
"rollup-plugin-svg": "^2.0.0",
7171
"rollup-plugin-typescript2": "^0.34.0",

pnpm-lock.yaml

Lines changed: 48 additions & 78 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rollup.config.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const terser = require('@rollup/plugin-terser')
55
const resolve = require('@rollup/plugin-node-resolve').default
66
const globals = require('rollup-plugin-node-globals')
77
const vue = require('rollup-plugin-vue')
8-
const copy = require('rollup-plugin-copy-watch')
8+
const copy = require('rollup-plugin-copy')
99
const csso = require('csso')
1010
const svg = require('rollup-plugin-svg')
1111
const json = require('@rollup/plugin-json')
@@ -70,15 +70,14 @@ formats.forEach(format => {
7070
const isWatchMode = process.env.npm_lifecycle_script.includes('--watch')
7171
configs[configs.length - 1].plugins.push(
7272
copy({
73-
watch: isWatchMode ? ['src/index.css'] : false,
7473
copyOnce: isWatchMode === false,
7574
verbose: true,
7675
targets: [
7776
{
7877
src: 'src/index.css',
7978
dest: 'dist',
8079
rename: (name, extension) => `${name}.min.${extension}`,
81-
transform: content => csso.minify(content).css,
80+
transform: content => csso.minify(content.toString()).css,
8281
},
8382
{ src: 'src/index.css', dest: 'dist' },
8483
],

0 commit comments

Comments
 (0)