ci: upgrade rollup

This commit is contained in:
liihuu 2023-12-10 01:23:29 +08:00
parent 755cb573a1
commit bbef07d50d
6 changed files with 19 additions and 20 deletions

View File

@ -13,7 +13,7 @@ jobs:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: actions/setup-node@v3 - uses: actions/setup-node@v3
with: with:
node-version: 16 node-version: 21
- run: npm install - run: npm install
- run: npm run lint - run: npm run lint
- run: npm run build - run: npm run build

View File

@ -17,7 +17,7 @@ jobs:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: actions/setup-node@v3 - uses: actions/setup-node@v3
with: with:
node-version: 16 node-version: 21
- run: npm install - run: npm install
- run: npm run docs:build - run: npm run docs:build
- uses: peaceiris/actions-gh-pages@v3 - uses: peaceiris/actions-gh-pages@v3

View File

@ -11,7 +11,7 @@ jobs:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: actions/setup-node@v3 - uses: actions/setup-node@v3
with: with:
node-version: 16 node-version: 21
- run: npm install && npm run build - run: npm install && npm run build
publish-npm: publish-npm:
@ -21,7 +21,7 @@ jobs:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: actions/setup-node@v3 - uses: actions/setup-node@v3
with: with:
node-version: 16 node-version: 21
registry-url: https://registry.npmjs.org/ registry-url: https://registry.npmjs.org/
- run: npm install && npm run build - run: npm install && npm run build
- run: npm publish - run: npm publish

View File

@ -49,18 +49,18 @@
"docs:deploy": "npm run docs:build && gh-pages -d website" "docs:deploy": "npm run docs:build && gh-pages -d website"
}, },
"engines": { "engines": {
"node": ">=16.0.0" "node": ">=18.0.0"
}, },
"devDependencies": { "devDependencies": {
"@babel/standalone": "^7.23.2", "@babel/standalone": "^7.23.2",
"@docsearch/css": "^3.3.3", "@docsearch/css": "^3.3.3",
"@docsearch/js": "^3.3.3", "@docsearch/js": "^3.3.3",
"@rollup/plugin-commonjs": "^23.0.2", "@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-eslint": "^9.0.1", "@rollup/plugin-eslint": "^9.0.5",
"@rollup/plugin-node-resolve": "^15.0.1", "@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-replace": "^5.0.1", "@rollup/plugin-replace": "^5.0.5",
"@rollup/plugin-terser": "^0.1.0", "@rollup/plugin-terser": "^0.4.4",
"@rollup/plugin-typescript": "^9.0.2", "@rollup/plugin-typescript": "^11.1.5",
"@stackblitz/sdk": "^1.9.0", "@stackblitz/sdk": "^1.9.0",
"@types/node": "^18.15.10", "@types/node": "^18.15.10",
"@typescript-eslint/eslint-plugin": "^5.36.2", "@typescript-eslint/eslint-plugin": "^5.36.2",
@ -78,8 +78,8 @@
"gh-pages": "^2.2.0", "gh-pages": "^2.2.0",
"husky": "^8.0.1", "husky": "^8.0.1",
"resize-observer-polyfill": "^1.5.1", "resize-observer-polyfill": "^1.5.1",
"rollup": "^3.2.5", "rollup": "^4.7.0",
"rollup-plugin-filesize": "^9.1.2", "rollup-plugin-filesize": "^10.0.0",
"rollup-plugin-progress": "^1.1.2", "rollup-plugin-progress": "^1.1.2",
"tslib": "^2.5.0", "tslib": "^2.5.0",
"typescript": "^4.8.3", "typescript": "^4.8.3",

View File

@ -14,18 +14,17 @@ async function build() {
const input = inputConfig(env); const input = inputConfig(env);
try { try {
const startTime = new Date().getTime()
const bundle = await rollup.rollup(input); const bundle = await rollup.rollup(input);
console.log('\n\nFile info: ');
const output = outputConfig(env, fileName); const output = outputConfig(env, fileName);
await bundle.write(output); await bundle.write(output);
console.log(chalk.green(`\nCompiled ${fileName} successfully.\n`)); console.log(chalk.green(`\n✔️ Compiled ${fileName} successfully.\n`));
console.log(`Done in ${((new Date().getTime() - startTime) / 1000 / 60).toFixed(2)}s.\n`)
} catch (err) { } catch (err) {
console.log(`\n\n${chalk.red(err)}\n`); console.log(`\n\n${chalk.red(err)}\n`);
console.log(chalk.red(`Failed to compile ${fileName}.\n`)); console.log(chalk.red(`✖️ Failed to compile ${fileName}.\n`));
process.exit(1); process.exit(1);
} }
} }

View File

@ -45,7 +45,7 @@ function clean () {
eachFiles(buildDir); eachFiles(buildDir);
deleteFiles(buildDir); deleteFiles(buildDir);
console.log(chalk.green('\n\nClean successfully.\n')); console.log(chalk.green('\n\n✔️ Clean successfully.\n'));
} }
clean(); clean();