Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update rollup packages #14003

Merged
merged 14 commits into from
Apr 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
28 changes: 0 additions & 28 deletions .yarn/patches/@rollup__plugin-commonjs.patch

This file was deleted.

18 changes: 6 additions & 12 deletions Gulpfile.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@ import { rollup } from "rollup";
import { babel as rollupBabel } from "@rollup/plugin-babel";
import rollupCommonJs from "@rollup/plugin-commonjs";
import rollupJson from "@rollup/plugin-json";
import rollupNodePolyfills from "rollup-plugin-node-polyfills";
import rollupPolyfillNode from "rollup-plugin-polyfill-node";
import rollupNodeResolve from "@rollup/plugin-node-resolve";
import rollupReplace from "@rollup/plugin-replace";
import { terser as rollupTerser } from "rollup-plugin-terser";
import _rollupDts from "rollup-plugin-dts";
const { default: rollupDts } = _rollupDts;
import rollupDts from "rollup-plugin-dts";
import { Worker as JestWorker } from "jest-worker";
import glob from "glob";
import { resolve as importMetaResolve } from "import-meta-resolve";
Expand Down Expand Up @@ -297,8 +296,6 @@ function buildRollup(packages, targetBrowsers) {
input,
external,
onwarn(warning, warn) {
const osifyPath = str => str.split("/").join(path.sep);

if (warning.code === "CIRCULAR_DEPENDENCY") return;
if (warning.code === "UNUSED_EXTERNAL_IMPORT") {
warn(warning);
Expand All @@ -310,15 +307,14 @@ function buildRollup(packages, targetBrowsers) {
// We can safely ignore this warning, and let Rollup replace it with undefined.
if (
warning.code === "MISSING_EXPORT" &&
warning.exporter ===
osifyPath("packages/babel-core/src/index.ts") &&
warning.exporter === "packages/babel-core/src/index.ts" &&
warning.missing === "default" &&
[
"@babel/helper-define-polyfill-provider",
"babel-plugin-polyfill-corejs2",
"babel-plugin-polyfill-corejs3",
"babel-plugin-polyfill-regenerator",
].some(pkg => warning.importer.includes(osifyPath(pkg)))
].some(pkg => warning.importer.includes(pkg))
) {
return;
}
Expand Down Expand Up @@ -348,8 +344,6 @@ function buildRollup(packages, targetBrowsers) {
// Rollup doesn't read export maps, so it loads the cjs fallback
"packages/babel-compat-data/*.js",
"packages/*/src/**/*.cjs",
// See the comment in this file for the reason to include it
"packages/babel-standalone/src/dynamic-require-entrypoint.cjs",
],
dynamicRequireTargets: [
// https://github.com/mathiasbynens/regexpu-core/blob/ffd8fff2e31f4597f6fdfee75d5ac1c5c8111ec3/rewrite-pattern.js#L48
Expand All @@ -361,7 +355,7 @@ function buildRollup(packages, targetBrowsers) {
) + "/**/*.js",
],
// Never delegate to the native require()
ignoreDynamicRequires: true,
ignoreDynamicRequires: false,
// Align with the Node.js behavior
defaultIsModuleExports: true,
}),
Expand All @@ -382,7 +376,7 @@ function buildRollup(packages, targetBrowsers) {
}),
rollupJson(),
targetBrowsers &&
rollupNodePolyfills({
rollupPolyfillNode({
sourceMap: sourcemap,
include: "**/*.{js,cjs,ts}",
}),
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@
"@babel/preset-flow": "^7.16.7",
"@babel/preset-typescript": "^7.16.7",
"@babel/runtime": "^7.17.0",
"@rollup/plugin-babel": "^5.3.0",
"@rollup/plugin-commonjs": "patch:@rollup/plugin-commonjs@^18.1.0#./.yarn/patches/@rollup__plugin-commonjs.patch",
"@rollup/plugin-babel": "^5.3.1",
"@rollup/plugin-commonjs": "22.0.0",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^13.0.0",
"@rollup/plugin-replace": "^2.4.2",
"@rollup/plugin-node-resolve": "^13.2.1",
"@rollup/plugin-replace": "^4.0.0",
"@types/node": "^16.7.13",
"@typescript-eslint/eslint-plugin": "^5.5.0",
"@typescript-eslint/parser": "^5.5.0",
Expand Down Expand Up @@ -67,9 +67,9 @@
"lint-staged": "^9.2.0",
"mergeiterator": "^1.4.4",
"prettier": "2.5.0",
"rollup": "~2.54.0",
"rollup-plugin-dts": "^2.0.0",
"rollup-plugin-node-polyfills": "^0.2.1",
"rollup": "^2.70.2",
"rollup-plugin-dts": "^4.2.1",
"rollup-plugin-polyfill-node": "^0.9.0",
"rollup-plugin-terser": "^7.0.2",
"semver": "^6.3.0",
"test262-stream": "^1.4.0",
Expand Down
13 changes: 0 additions & 13 deletions packages/babel-standalone/src/dynamic-require-entrypoint.cjs

This file was deleted.

3 changes: 0 additions & 3 deletions packages/babel-standalone/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
/* eslint-disable max-len */
/// <reference lib="dom" />

// $FlowIgnore
import "./dynamic-require-entrypoint.cjs";

import {
transformFromAst as babelTransformFromAst,
transform as babelTransform,
Expand Down
6 changes: 3 additions & 3 deletions test/runtime-integration/rollup/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"private": true,
"devDependencies": {
"@babel/runtime": "workspace:^",
"@rollup/plugin-commonjs": "^18.1.0",
"@rollup/plugin-node-resolve": "^13.0.0",
"rollup": "~2.54.0"
"@rollup/plugin-commonjs": "22.0.0",
"@rollup/plugin-node-resolve": "^13.2.1",
"rollup": "^2.70.2"
}
}