From 75091ef273280a96dcc9b2e12717ffec86c9cea9 Mon Sep 17 00:00:00 2001 From: Ernest Date: Tue, 26 Mar 2024 13:24:13 +0800 Subject: [PATCH] build: migrate to rollup-plugin-copy --- package.json | 2 +- pnpm-lock.yaml | 126 ++++++++++++++++++----------------------------- rollup.config.js | 5 +- 3 files changed, 51 insertions(+), 82 deletions(-) diff --git a/package.json b/package.json index bfb23833..c0d4845b 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,7 @@ "prettier": "^2.0.5", "rimraf": "^5.0.0", "rollup": "^3.0.0", - "rollup-plugin-copy-watch": "^0.0.1", + "rollup-plugin-copy": "^3.5.0", "rollup-plugin-node-globals": "^1.4.0", "rollup-plugin-svg": "^2.0.0", "rollup-plugin-typescript2": "^0.34.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a47c3124..c1b69656 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -24,7 +24,7 @@ specifiers: prettier: ^2.0.5 rimraf: ^5.0.0 rollup: ^3.0.0 - rollup-plugin-copy-watch: ^0.0.1 + rollup-plugin-copy: ^3.5.0 rollup-plugin-node-globals: ^1.4.0 rollup-plugin-svg: ^2.0.0 rollup-plugin-typescript2: ^0.34.0 @@ -59,7 +59,7 @@ devDependencies: prettier: 2.8.8 rimraf: 5.0.5 rollup: 3.22.0 - rollup-plugin-copy-watch: 0.0.1 + rollup-plugin-copy: 3.5.0 rollup-plugin-node-globals: 1.4.0 rollup-plugin-svg: 2.0.0 rollup-plugin-typescript2: 0.34.1_td7na2ke7rgjbmlu5ash6l7mam @@ -1791,25 +1791,25 @@ packages: '@jridgewell/sourcemap-codec': 1.4.15 dev: true - /@nodelib/fs.scandir/2.1.3: - resolution: {integrity: sha512-eGmwYQn3gxo4r7jdQnkrrN6bY478C3P+a/y72IJukF8LjB6ZHeB3c+Ehacj3sYeSmUXGlnA67/PmbM9CVwL7Dw==} + /@nodelib/fs.scandir/2.1.5: + resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} engines: {node: '>= 8'} dependencies: - '@nodelib/fs.stat': 2.0.3 - run-parallel: 1.1.9 + '@nodelib/fs.stat': 2.0.5 + run-parallel: 1.2.0 dev: true - /@nodelib/fs.stat/2.0.3: - resolution: {integrity: sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA==} + /@nodelib/fs.stat/2.0.5: + resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} engines: {node: '>= 8'} dev: true - /@nodelib/fs.walk/1.2.4: - resolution: {integrity: sha512-1V9XOY4rDW0rehzbrcqAmHnz8e7SKvX27gh8Gt2WgB0+pdzdiLV83p72kZPU+jvMbS1qU5mauP2iOvO8rhmurQ==} + /@nodelib/fs.walk/1.2.8: + resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} engines: {node: '>= 8'} dependencies: - '@nodelib/fs.scandir': 2.1.3 - fastq: 1.8.0 + '@nodelib/fs.scandir': 2.1.5 + fastq: 1.17.1 dev: true /@one-ini/wasm/0.1.1: @@ -1979,16 +1979,16 @@ packages: resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==} dev: true - /@types/fs-extra/8.1.1: - resolution: {integrity: sha512-TcUlBem321DFQzBNuz8p0CLLKp0VvF/XH9E4KHNmgwyp4E3AfgI5cjiIVZWlbfThBop2qxFIh4+LeY6hVWWZ2w==} + /@types/fs-extra/8.1.5: + resolution: {integrity: sha512-0dzKcwO+S8s2kuF5Z9oUWatQJj5Uq/iqphEtE3GQJVRRYm/tD1LglU2UnXi2A8jLq5umkGouOXOR9y0n613ZwQ==} dependencies: '@types/node': 20.11.30 dev: true - /@types/glob/7.1.3: - resolution: {integrity: sha512-SEYeGAIQIQX8NN6LDKprLjbrd5dARM5EXsd8GI/A5l0apYI1fGMWgPHSe4ZKL4eozlAyI+doUE9XbYS4xCkQ1w==} + /@types/glob/7.2.0: + resolution: {integrity: sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==} dependencies: - '@types/minimatch': 3.0.3 + '@types/minimatch': 5.1.2 '@types/node': 20.11.30 dev: true @@ -2029,8 +2029,8 @@ packages: parse5: 7.1.2 dev: true - /@types/minimatch/3.0.3: - resolution: {integrity: sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==} + /@types/minimatch/5.1.2: + resolution: {integrity: sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==} dev: true /@types/minimist/1.2.2: @@ -2497,11 +2497,6 @@ packages: tweetnacl: 0.14.5 dev: true - /binary-extensions/2.2.0: - resolution: {integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==} - engines: {node: '>=8'} - dev: true - /blob-util/2.0.2: resolution: {integrity: sha512-T7JQa+zsXXEa6/8ZhHcQEW1UFfVM49Ts65uBkFL6fz2QmrElqmbajIDJvuA0tEhRe5eIjpV9ZF+0RfZR9voJFQ==} dev: true @@ -2642,21 +2637,6 @@ packages: engines: {node: '>= 0.8.0'} dev: true - /chokidar/3.5.1: - resolution: {integrity: sha512-9+s+Od+W0VJJzawDma/gvBNQqkTiqYTWLuZoyAsivsI4AaWTCzHG06/TMjsf1cYe9Cb97UCEhjz7HvnPk2p/tw==} - engines: {node: '>= 8.10.0'} - dependencies: - anymatch: 3.1.3 - braces: 3.0.2 - glob-parent: 5.1.2 - is-binary-path: 2.1.0 - is-glob: 4.0.1 - normalize-path: 3.0.0 - readdirp: 3.5.0 - optionalDependencies: - fsevents: 2.3.2 - dev: true - /ci-info/3.9.0: resolution: {integrity: sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==} engines: {node: '>=8'} @@ -2742,8 +2722,8 @@ packages: resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} dev: true - /colorette/1.2.2: - resolution: {integrity: sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w==} + /colorette/1.4.0: + resolution: {integrity: sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g==} dev: true /colorette/2.0.19: @@ -3505,16 +3485,15 @@ packages: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} dev: true - /fast-glob/3.2.4: - resolution: {integrity: sha512-kr/Oo6PX51265qeuCYsyGypiO5uJFgBS0jksyG7FUeCyQzNwYnzrNIMR1NXfkZXsMYXYLRAHgISHBz8gQcxKHQ==} - engines: {node: '>=8'} + /fast-glob/3.3.2: + resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} + engines: {node: '>=8.6.0'} dependencies: - '@nodelib/fs.stat': 2.0.3 - '@nodelib/fs.walk': 1.2.4 + '@nodelib/fs.stat': 2.0.5 + '@nodelib/fs.walk': 1.2.8 glob-parent: 5.1.2 merge2: 1.4.1 micromatch: 4.0.5 - picomatch: 2.3.1 dev: true /fast-json-stable-stringify/2.1.0: @@ -3525,8 +3504,8 @@ packages: resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} dev: true - /fastq/1.8.0: - resolution: {integrity: sha512-SMIZoZdLh/fgofivvIkmknUXyPnvxRE3DhtZ5Me3Mrsk5gyPL42F0xr51TdRXskBxHfMp+07bcYzfsYEsSQA9Q==} + /fastq/1.17.1: + resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} dependencies: reusify: 1.0.4 dev: true @@ -3768,7 +3747,7 @@ packages: resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} engines: {node: '>= 6'} dependencies: - is-glob: 4.0.1 + is-glob: 4.0.3 dev: true /glob/10.3.10: @@ -3817,12 +3796,12 @@ packages: resolution: {integrity: sha512-sSs4inE1FB2YQiymcmTv6NWENryABjUNPeWhOvmn4SjtKybglsyPZxFB3U1/+L1bYi0rNZDqCLlHyLYDl1Pq5A==} engines: {node: '>=8'} dependencies: - '@types/glob': 7.1.3 + '@types/glob': 7.2.0 array-union: 2.1.0 dir-glob: 3.0.1 - fast-glob: 3.2.4 + fast-glob: 3.3.2 glob: 7.2.3 - ignore: 5.1.8 + ignore: 5.3.1 merge2: 1.4.1 slash: 3.0.0 dev: true @@ -3949,8 +3928,8 @@ packages: resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} dev: true - /ignore/5.1.8: - resolution: {integrity: sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==} + /ignore/5.3.1: + resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==} engines: {node: '>= 4'} dev: true @@ -4005,13 +3984,6 @@ packages: resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} dev: true - /is-binary-path/2.1.0: - resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==} - engines: {node: '>=8'} - dependencies: - binary-extensions: 2.2.0 - dev: true - /is-builtin-module/3.2.1: resolution: {integrity: sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==} engines: {node: '>=6'} @@ -4047,8 +4019,8 @@ packages: engines: {node: '>=6'} dev: true - /is-glob/4.0.1: - resolution: {integrity: sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==} + /is-glob/4.0.3: + resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} engines: {node: '>=0.10.0'} dependencies: is-extglob: 2.1.1 @@ -5467,6 +5439,10 @@ packages: resolution: {integrity: sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==} dev: true + /queue-microtask/1.2.3: + resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} + dev: true + /quick-lru/4.0.1: resolution: {integrity: sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==} engines: {node: '>=8'} @@ -5533,13 +5509,6 @@ packages: util-deprecate: 1.0.2 dev: true - /readdirp/3.5.0: - resolution: {integrity: sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ==} - engines: {node: '>=8.10.0'} - dependencies: - picomatch: 2.3.1 - dev: true - /redent/3.0.0: resolution: {integrity: sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==} engines: {node: '>=8'} @@ -5678,13 +5647,12 @@ packages: glob: 10.3.10 dev: true - /rollup-plugin-copy-watch/0.0.1: - resolution: {integrity: sha512-TjlXZsmsdLWd4Jx1M6qUQqLgRxJlTpmHchPTN6s4d58ubYAa7DlbMrqGz5In1Xg/iN7p19YNpcGGKWu0ImHpVg==} + /rollup-plugin-copy/3.5.0: + resolution: {integrity: sha512-wI8D5dvYovRMx/YYKtUNt3Yxaw4ORC9xo6Gt9t22kveWz1enG9QrhVlagzwrxSC455xD1dHMKhIJkbsQ7d48BA==} engines: {node: '>=8.3'} dependencies: - '@types/fs-extra': 8.1.1 - chokidar: 3.5.1 - colorette: 1.2.2 + '@types/fs-extra': 8.1.5 + colorette: 1.4.0 fs-extra: 8.1.0 globby: 10.0.1 is-plain-object: 3.0.1 @@ -5756,8 +5724,10 @@ packages: fsevents: 2.3.2 dev: true - /run-parallel/1.1.9: - resolution: {integrity: sha512-DEqnSRTDw/Tc3FXf49zedI638Z9onwUotBMiUFKmrO2sdFKIbXamXGQ3Axd4qgphxKB4kw/qP1w5kTxnfU1B9Q==} + /run-parallel/1.2.0: + resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} + dependencies: + queue-microtask: 1.2.3 dev: true /rxjs/7.6.0: diff --git a/rollup.config.js b/rollup.config.js index 1969dab5..d48e679f 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -5,7 +5,7 @@ const terser = require('@rollup/plugin-terser') const resolve = require('@rollup/plugin-node-resolve').default const globals = require('rollup-plugin-node-globals') const vue = require('rollup-plugin-vue') -const copy = require('rollup-plugin-copy-watch') +const copy = require('rollup-plugin-copy') const csso = require('csso') const svg = require('rollup-plugin-svg') const json = require('@rollup/plugin-json') @@ -70,7 +70,6 @@ formats.forEach(format => { const isWatchMode = process.env.npm_lifecycle_script.includes('--watch') configs[configs.length - 1].plugins.push( copy({ - watch: isWatchMode ? ['src/index.css'] : false, copyOnce: isWatchMode === false, verbose: true, targets: [ @@ -78,7 +77,7 @@ configs[configs.length - 1].plugins.push( src: 'src/index.css', dest: 'dist', rename: (name, extension) => `${name}.min.${extension}`, - transform: content => csso.minify(content).css, + transform: content => csso.minify(content.toString()).css, }, { src: 'src/index.css', dest: 'dist' }, ],