feat(building-rollup): update to rollup v3 + v3 plugins

This commit is contained in:
Thomas Allmer
2023-06-27 14:41:35 +02:00
parent 685e6fd9b4
commit 74b2b35812
8 changed files with 692 additions and 560 deletions

View File

@@ -0,0 +1,6 @@
---
'@rocket/building-rollup': minor
'@rocket/cli': minor
---
Update to Rollup v3 + all plugins that require it

1204
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -48,9 +48,10 @@
"@custom-elements-manifest/analyzer": "^0.4.12",
"@open-wc/testing": "^3.1.2",
"@playwright/test": "^1.18.1",
"@rollup/plugin-commonjs": "^17.0.0",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-typescript": "^8.1.0",
"@rollup/plugin-commonjs": "^25.0.0",
"@rollup/plugin-json": "^6.0.0",
"@rollup/plugin-terser": "^0.4.0",
"@rollup/plugin-typescript": "^11.1.0",
"@types/chai": "^4.2.14",
"@types/fs-extra": "^9.0.6",
"@types/mocha": "^9.0.0",
@@ -82,8 +83,7 @@
"puppeteer": "^13.0.0",
"remark-emoji": "^2.1.0",
"rimraf": "^3.0.2",
"rollup": "^2.36.1",
"rollup-plugin-terser": "^7.0.2",
"rollup": "^3.0.0",
"sinon": "^9.2.3",
"ts-node": "^9.1.1",
"typescript": "^4.8.4",

View File

@@ -52,20 +52,20 @@
"rollup"
],
"peerDependencies": {
"rollup": "^2.35.0"
"rollup": "^3.0.0"
},
"dependencies": {
"@babel/core": "^7.20.12",
"@babel/preset-env": "^7.12.11",
"@rollup/plugin-babel": "^5.2.2",
"@rollup/plugin-babel": "^6.0.0",
"@rollup/plugin-node-resolve": "^15.0.1",
"@rollup/plugin-replace": "^5.0.1",
"@web/rollup-plugin-html": "^1.8.0",
"@web/rollup-plugin-import-meta-assets": "^1.0.4",
"@web/rollup-plugin-polyfills-loader": "^1.1.0",
"@rollup/plugin-terser": "^0.4.0",
"@web/rollup-plugin-html": "^2.0.0",
"@web/rollup-plugin-import-meta-assets": "^2.0.0",
"@web/rollup-plugin-polyfills-loader": "^2.0.0",
"browserslist": "^4.16.1",
"plugins-manager": "^0.3.1",
"rollup-plugin-terser": "^7.0.2",
"workbox-broadcast-update": "^6.1.5",
"workbox-cacheable-response": "^6.1.5",
"workbox-expiration": "^6.1.5",

View File

@@ -1,12 +1,9 @@
import resolve from '@rollup/plugin-node-resolve';
// @ts-ignore
import { terser } from 'rollup-plugin-terser';
import babelPkg from '@rollup/plugin-babel';
import terser from '@rollup/plugin-terser';
import { babel } from '@rollup/plugin-babel';
import { applyPlugins } from 'plugins-manager';
const { babel } = babelPkg;
/** @typedef {import('../types/main.js').BuildingRollupOptions} BuildingRollupOptions */
/**
@@ -84,6 +81,7 @@ export function createBasicMetaConfig(userConfig = { output: {} }) {
},
},
{
// @ts-ignore
plugin: terser,
options: {},
},

View File

@@ -1,13 +1,10 @@
import resolve from '@rollup/plugin-node-resolve';
// @ts-ignore
import { terser } from 'rollup-plugin-terser';
import babelPkg from '@rollup/plugin-babel';
import terser from '@rollup/plugin-terser';
import { babel } from '@rollup/plugin-babel';
import replace from '@rollup/plugin-replace';
import { applyPlugins } from 'plugins-manager';
const { babel } = babelPkg;
/** @typedef {import('../types/main.js').BuildingRollupOptions} BuildingRollupOptions */
/**
@@ -86,6 +83,7 @@ export function createServiceWorkerMetaConfig(userConfig = { output: {} }) {
},
},
{
// @ts-ignore
plugin: terser,
options: {
mangle: {

View File

@@ -52,7 +52,7 @@
"rollup"
],
"dependencies": {
"@rocket/building-rollup": "^0.4.0",
"@rocket/building-rollup": "^0.4.1",
"@rocket/engine": "^0.2.7",
"check-html-links": "^0.2.4",
"colorette": "^2.0.16",

View File

@@ -74,7 +74,7 @@ describe('Config', () => {
testOptions: { captureLogs: true },
});
await build();
const inlineModule = await readOutput('e97af63d.js', { format: false });
const inlineModule = await readOutput('ddcef8d1.js', { format: false });
expect(inlineModule).to.equal('var a={test:"data"};console.log(a);\n');
});