mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-09-29 16:57:00 +08:00
[deps] Update rollup to 4.24.3 (and update plugins)
Since we have the major version jump, we needed to update quite
a few things to make this work:
1. rollup4 ships with native binaries. We can't check them into
our node_modules for all platforms. Luckily they also ship a
a wasm version. This requires us to adjust the 'binary' path
to `node_modules/@rollup/wasm-node/dist/bin/rollup` instead.
2. rollup4 is more strict when it comes to ES modules vs
CommonJS. We adjust this by renaming the rollup config files.
3. Some plugins got deprecated so we had to replace them with
the newer versions (source maps and terser).
Bug: None
Change-Id: If13d590c8185db6ad85b3992d0a869111909dc8c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/5999255
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
This commit is contained in:
committed by
Devtools-frontend LUCI CQ
parent
6c24f89b99
commit
abf0cd1847
+44
-148
@@ -3,12 +3,9 @@
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
var path = require('path');
|
||||
var estreeWalker = require('estree-walker');
|
||||
var pm = require('picomatch');
|
||||
|
||||
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
||||
|
||||
var pm__default = /*#__PURE__*/_interopDefaultLegacy(pm);
|
||||
|
||||
const addExtension = function addExtension(filename, ext = '.js') {
|
||||
let result = `${filename}`;
|
||||
if (!path.extname(filename))
|
||||
@@ -16,141 +13,6 @@ const addExtension = function addExtension(filename, ext = '.js') {
|
||||
return result;
|
||||
};
|
||||
|
||||
class WalkerBase {constructor() { WalkerBase.prototype.__init.call(this);WalkerBase.prototype.__init2.call(this);WalkerBase.prototype.__init3.call(this);WalkerBase.prototype.__init4.call(this); }
|
||||
__init() {this.should_skip = false;}
|
||||
__init2() {this.should_remove = false;}
|
||||
__init3() {this.replacement = null;}
|
||||
|
||||
__init4() {this.context = {
|
||||
skip: () => (this.should_skip = true),
|
||||
remove: () => (this.should_remove = true),
|
||||
replace: (node) => (this.replacement = node)
|
||||
};}
|
||||
|
||||
replace(parent, prop, index, node) {
|
||||
if (parent) {
|
||||
if (index !== null) {
|
||||
parent[prop][index] = node;
|
||||
} else {
|
||||
parent[prop] = node;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
remove(parent, prop, index) {
|
||||
if (parent) {
|
||||
if (index !== null) {
|
||||
parent[prop].splice(index, 1);
|
||||
} else {
|
||||
delete parent[prop];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class SyncWalkerClass extends WalkerBase {
|
||||
|
||||
|
||||
|
||||
constructor(walker) {
|
||||
super();
|
||||
this.enter = walker.enter;
|
||||
this.leave = walker.leave;
|
||||
}
|
||||
|
||||
visit(
|
||||
node,
|
||||
parent,
|
||||
enter,
|
||||
leave,
|
||||
prop,
|
||||
index
|
||||
) {
|
||||
if (node) {
|
||||
if (enter) {
|
||||
const _should_skip = this.should_skip;
|
||||
const _should_remove = this.should_remove;
|
||||
const _replacement = this.replacement;
|
||||
this.should_skip = false;
|
||||
this.should_remove = false;
|
||||
this.replacement = null;
|
||||
|
||||
enter.call(this.context, node, parent, prop, index);
|
||||
|
||||
if (this.replacement) {
|
||||
node = this.replacement;
|
||||
this.replace(parent, prop, index, node);
|
||||
}
|
||||
|
||||
if (this.should_remove) {
|
||||
this.remove(parent, prop, index);
|
||||
}
|
||||
|
||||
const skipped = this.should_skip;
|
||||
const removed = this.should_remove;
|
||||
|
||||
this.should_skip = _should_skip;
|
||||
this.should_remove = _should_remove;
|
||||
this.replacement = _replacement;
|
||||
|
||||
if (skipped) return node;
|
||||
if (removed) return null;
|
||||
}
|
||||
|
||||
for (const key in node) {
|
||||
const value = (node )[key];
|
||||
|
||||
if (typeof value !== "object") {
|
||||
continue;
|
||||
} else if (Array.isArray(value)) {
|
||||
for (let i = 0; i < value.length; i += 1) {
|
||||
if (value[i] !== null && typeof value[i].type === 'string') {
|
||||
if (!this.visit(value[i], node, enter, leave, key, i)) {
|
||||
// removed
|
||||
i--;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (value !== null && typeof value.type === "string") {
|
||||
this.visit(value, node, enter, leave, key, null);
|
||||
}
|
||||
}
|
||||
|
||||
if (leave) {
|
||||
const _replacement = this.replacement;
|
||||
const _should_remove = this.should_remove;
|
||||
this.replacement = null;
|
||||
this.should_remove = false;
|
||||
|
||||
leave.call(this.context, node, parent, prop, index);
|
||||
|
||||
if (this.replacement) {
|
||||
node = this.replacement;
|
||||
this.replace(parent, prop, index, node);
|
||||
}
|
||||
|
||||
if (this.should_remove) {
|
||||
this.remove(parent, prop, index);
|
||||
}
|
||||
|
||||
const removed = this.should_remove;
|
||||
|
||||
this.replacement = _replacement;
|
||||
this.should_remove = _should_remove;
|
||||
|
||||
if (removed) return null;
|
||||
}
|
||||
}
|
||||
|
||||
return node;
|
||||
}
|
||||
}
|
||||
|
||||
function walk(ast, walker) {
|
||||
const instance = new SyncWalkerClass(walker);
|
||||
return instance.visit(ast, null, walker.enter, walker.leave);
|
||||
}
|
||||
|
||||
const extractors = {
|
||||
ArrayPattern(names, param) {
|
||||
for (const element of param.elements) {
|
||||
@@ -221,12 +83,12 @@ class Scope {
|
||||
}
|
||||
const attachScopes = function attachScopes(ast, propertyName = 'scope') {
|
||||
let scope = new Scope();
|
||||
walk(ast, {
|
||||
estreeWalker.walk(ast, {
|
||||
enter(n, parent) {
|
||||
const node = n;
|
||||
// function foo () {...}
|
||||
// class Foo {...}
|
||||
if (/(Function|Class)Declaration/.test(node.type)) {
|
||||
if (/(?:Function|Class)Declaration/.test(node.type)) {
|
||||
scope.addDeclaration(node, false, false);
|
||||
}
|
||||
// var foo = 1
|
||||
@@ -253,7 +115,7 @@ const attachScopes = function attachScopes(ast, propertyName = 'scope') {
|
||||
}
|
||||
}
|
||||
// create new for scope
|
||||
if (/For(In|Of)?Statement/.test(node.type)) {
|
||||
if (/For(?:In|Of)?Statement/.test(node.type)) {
|
||||
newScope = new Scope({
|
||||
parent: scope,
|
||||
block: true
|
||||
@@ -303,12 +165,13 @@ function ensureArray(thing) {
|
||||
return [thing];
|
||||
}
|
||||
|
||||
const normalizePathRegExp = new RegExp(`\\${path.win32.sep}`, 'g');
|
||||
const normalizePath = function normalizePath(filename) {
|
||||
return filename.split(path.win32.sep).join(path.posix.sep);
|
||||
return filename.replace(normalizePathRegExp, path.posix.sep);
|
||||
};
|
||||
|
||||
function getMatcherString(id, resolutionBase) {
|
||||
if (resolutionBase === false || path.isAbsolute(id) || id.startsWith('*')) {
|
||||
if (resolutionBase === false || path.isAbsolute(id) || id.startsWith('**')) {
|
||||
return normalizePath(id);
|
||||
}
|
||||
// resolve('') is valid and will default to process.cwd()
|
||||
@@ -329,17 +192,19 @@ const createFilter = function createFilter(include, exclude, options) {
|
||||
test: (what) => {
|
||||
// this refactor is a tad overly verbose but makes for easy debugging
|
||||
const pattern = getMatcherString(id, resolutionBase);
|
||||
const fn = pm__default["default"](pattern, { dot: true });
|
||||
const fn = pm(pattern, { dot: true });
|
||||
const result = fn(what);
|
||||
return result;
|
||||
}
|
||||
};
|
||||
const includeMatchers = ensureArray(include).map(getMatcher);
|
||||
const excludeMatchers = ensureArray(exclude).map(getMatcher);
|
||||
if (!includeMatchers.length && !excludeMatchers.length)
|
||||
return (id) => typeof id === 'string' && !id.includes('\0');
|
||||
return function result(id) {
|
||||
if (typeof id !== 'string')
|
||||
return false;
|
||||
if (/\0/.test(id))
|
||||
if (id.includes('\0'))
|
||||
return false;
|
||||
const pathId = normalizePath(id);
|
||||
for (let i = 0; i < excludeMatchers.length; ++i) {
|
||||
@@ -415,6 +280,7 @@ function serialize(obj, indent, baseIndent) {
|
||||
}
|
||||
if (typeof obj === 'symbol') {
|
||||
const key = Symbol.keyFor(obj);
|
||||
// eslint-disable-next-line no-undefined
|
||||
if (key !== undefined)
|
||||
return `Symbol.for(${stringify(key)})`;
|
||||
}
|
||||
@@ -422,7 +288,17 @@ function serialize(obj, indent, baseIndent) {
|
||||
return `${obj}n`;
|
||||
return stringify(obj);
|
||||
}
|
||||
// isWellFormed exists from Node.js 20
|
||||
const hasStringIsWellFormed = 'isWellFormed' in String.prototype;
|
||||
function isWellFormedString(input) {
|
||||
// @ts-expect-error String::isWellFormed exists from ES2024. tsconfig lib is set to ES6
|
||||
if (hasStringIsWellFormed)
|
||||
return input.isWellFormed();
|
||||
// https://github.com/tc39/proposal-is-usv-string/blob/main/README.md#algorithm
|
||||
return !/\p{Surrogate}/u.test(input);
|
||||
}
|
||||
const dataToEsm = function dataToEsm(data, options = {}) {
|
||||
var _a, _b;
|
||||
const t = options.compact ? '' : 'indent' in options ? options.indent : '\t';
|
||||
const _ = options.compact ? '' : ' ';
|
||||
const n = options.compact ? '' : '\n';
|
||||
@@ -437,8 +313,17 @@ const dataToEsm = function dataToEsm(data, options = {}) {
|
||||
const magic = _ || (/^[{[\-\/]/.test(code) ? '' : ' '); // eslint-disable-line no-useless-escape
|
||||
return `export default${magic}${code};`;
|
||||
}
|
||||
let maxUnderbarPrefixLength = 0;
|
||||
for (const key of Object.keys(data)) {
|
||||
const underbarPrefixLength = (_b = (_a = /^(_+)/.exec(key)) === null || _a === void 0 ? void 0 : _a[0].length) !== null && _b !== void 0 ? _b : 0;
|
||||
if (underbarPrefixLength > maxUnderbarPrefixLength) {
|
||||
maxUnderbarPrefixLength = underbarPrefixLength;
|
||||
}
|
||||
}
|
||||
const arbitraryNamePrefix = `${'_'.repeat(maxUnderbarPrefixLength + 1)}arbitrary`;
|
||||
let namedExportCode = '';
|
||||
const defaultExportRows = [];
|
||||
const arbitraryNameExportRows = [];
|
||||
for (const [key, value] of Object.entries(data)) {
|
||||
if (key === makeLegalIdentifier(key)) {
|
||||
if (options.objectShorthand)
|
||||
@@ -449,9 +334,18 @@ const dataToEsm = function dataToEsm(data, options = {}) {
|
||||
}
|
||||
else {
|
||||
defaultExportRows.push(`${stringify(key)}:${_}${serialize(value, options.compact ? null : t, '')}`);
|
||||
if (options.includeArbitraryNames && isWellFormedString(key)) {
|
||||
const variableName = `${arbitraryNamePrefix}${arbitraryNameExportRows.length}`;
|
||||
namedExportCode += `${declarationType} ${variableName}${_}=${_}${serialize(value, options.compact ? null : t, '')};${n}`;
|
||||
arbitraryNameExportRows.push(`${variableName} as ${JSON.stringify(key)}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
return `${namedExportCode}export default${_}{${n}${t}${defaultExportRows.join(`,${n}${t}`)}${n}};${n}`;
|
||||
const arbitraryExportCode = arbitraryNameExportRows.length > 0
|
||||
? `export${_}{${n}${t}${arbitraryNameExportRows.join(`,${n}${t}`)}${n}};${n}`
|
||||
: '';
|
||||
const defaultExportCode = `export default${_}{${n}${t}${defaultExportRows.join(`,${n}${t}`)}${n}};${n}`;
|
||||
return `${namedExportCode}${arbitraryExportCode}${defaultExportCode}`;
|
||||
};
|
||||
|
||||
// TODO: remove this in next major
|
||||
@@ -469,7 +363,9 @@ exports.addExtension = addExtension;
|
||||
exports.attachScopes = attachScopes;
|
||||
exports.createFilter = createFilter;
|
||||
exports.dataToEsm = dataToEsm;
|
||||
exports["default"] = index;
|
||||
exports.default = index;
|
||||
exports.extractAssignedNames = extractAssignedNames;
|
||||
exports.makeLegalIdentifier = makeLegalIdentifier;
|
||||
exports.normalizePath = normalizePath;
|
||||
module.exports = Object.assign(exports.default, exports);
|
||||
//# sourceMappingURL=index.js.map
|
||||
|
||||
+40
-141
@@ -1,4 +1,5 @@
|
||||
import { extname, win32, posix, isAbsolute, resolve } from 'path';
|
||||
import { walk } from 'estree-walker';
|
||||
import pm from 'picomatch';
|
||||
|
||||
const addExtension = function addExtension(filename, ext = '.js') {
|
||||
@@ -8,141 +9,6 @@ const addExtension = function addExtension(filename, ext = '.js') {
|
||||
return result;
|
||||
};
|
||||
|
||||
class WalkerBase {constructor() { WalkerBase.prototype.__init.call(this);WalkerBase.prototype.__init2.call(this);WalkerBase.prototype.__init3.call(this);WalkerBase.prototype.__init4.call(this); }
|
||||
__init() {this.should_skip = false;}
|
||||
__init2() {this.should_remove = false;}
|
||||
__init3() {this.replacement = null;}
|
||||
|
||||
__init4() {this.context = {
|
||||
skip: () => (this.should_skip = true),
|
||||
remove: () => (this.should_remove = true),
|
||||
replace: (node) => (this.replacement = node)
|
||||
};}
|
||||
|
||||
replace(parent, prop, index, node) {
|
||||
if (parent) {
|
||||
if (index !== null) {
|
||||
parent[prop][index] = node;
|
||||
} else {
|
||||
parent[prop] = node;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
remove(parent, prop, index) {
|
||||
if (parent) {
|
||||
if (index !== null) {
|
||||
parent[prop].splice(index, 1);
|
||||
} else {
|
||||
delete parent[prop];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class SyncWalkerClass extends WalkerBase {
|
||||
|
||||
|
||||
|
||||
constructor(walker) {
|
||||
super();
|
||||
this.enter = walker.enter;
|
||||
this.leave = walker.leave;
|
||||
}
|
||||
|
||||
visit(
|
||||
node,
|
||||
parent,
|
||||
enter,
|
||||
leave,
|
||||
prop,
|
||||
index
|
||||
) {
|
||||
if (node) {
|
||||
if (enter) {
|
||||
const _should_skip = this.should_skip;
|
||||
const _should_remove = this.should_remove;
|
||||
const _replacement = this.replacement;
|
||||
this.should_skip = false;
|
||||
this.should_remove = false;
|
||||
this.replacement = null;
|
||||
|
||||
enter.call(this.context, node, parent, prop, index);
|
||||
|
||||
if (this.replacement) {
|
||||
node = this.replacement;
|
||||
this.replace(parent, prop, index, node);
|
||||
}
|
||||
|
||||
if (this.should_remove) {
|
||||
this.remove(parent, prop, index);
|
||||
}
|
||||
|
||||
const skipped = this.should_skip;
|
||||
const removed = this.should_remove;
|
||||
|
||||
this.should_skip = _should_skip;
|
||||
this.should_remove = _should_remove;
|
||||
this.replacement = _replacement;
|
||||
|
||||
if (skipped) return node;
|
||||
if (removed) return null;
|
||||
}
|
||||
|
||||
for (const key in node) {
|
||||
const value = (node )[key];
|
||||
|
||||
if (typeof value !== "object") {
|
||||
continue;
|
||||
} else if (Array.isArray(value)) {
|
||||
for (let i = 0; i < value.length; i += 1) {
|
||||
if (value[i] !== null && typeof value[i].type === 'string') {
|
||||
if (!this.visit(value[i], node, enter, leave, key, i)) {
|
||||
// removed
|
||||
i--;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (value !== null && typeof value.type === "string") {
|
||||
this.visit(value, node, enter, leave, key, null);
|
||||
}
|
||||
}
|
||||
|
||||
if (leave) {
|
||||
const _replacement = this.replacement;
|
||||
const _should_remove = this.should_remove;
|
||||
this.replacement = null;
|
||||
this.should_remove = false;
|
||||
|
||||
leave.call(this.context, node, parent, prop, index);
|
||||
|
||||
if (this.replacement) {
|
||||
node = this.replacement;
|
||||
this.replace(parent, prop, index, node);
|
||||
}
|
||||
|
||||
if (this.should_remove) {
|
||||
this.remove(parent, prop, index);
|
||||
}
|
||||
|
||||
const removed = this.should_remove;
|
||||
|
||||
this.replacement = _replacement;
|
||||
this.should_remove = _should_remove;
|
||||
|
||||
if (removed) return null;
|
||||
}
|
||||
}
|
||||
|
||||
return node;
|
||||
}
|
||||
}
|
||||
|
||||
function walk(ast, walker) {
|
||||
const instance = new SyncWalkerClass(walker);
|
||||
return instance.visit(ast, null, walker.enter, walker.leave);
|
||||
}
|
||||
|
||||
const extractors = {
|
||||
ArrayPattern(names, param) {
|
||||
for (const element of param.elements) {
|
||||
@@ -218,7 +84,7 @@ const attachScopes = function attachScopes(ast, propertyName = 'scope') {
|
||||
const node = n;
|
||||
// function foo () {...}
|
||||
// class Foo {...}
|
||||
if (/(Function|Class)Declaration/.test(node.type)) {
|
||||
if (/(?:Function|Class)Declaration/.test(node.type)) {
|
||||
scope.addDeclaration(node, false, false);
|
||||
}
|
||||
// var foo = 1
|
||||
@@ -245,7 +111,7 @@ const attachScopes = function attachScopes(ast, propertyName = 'scope') {
|
||||
}
|
||||
}
|
||||
// create new for scope
|
||||
if (/For(In|Of)?Statement/.test(node.type)) {
|
||||
if (/For(?:In|Of)?Statement/.test(node.type)) {
|
||||
newScope = new Scope({
|
||||
parent: scope,
|
||||
block: true
|
||||
@@ -295,12 +161,13 @@ function ensureArray(thing) {
|
||||
return [thing];
|
||||
}
|
||||
|
||||
const normalizePathRegExp = new RegExp(`\\${win32.sep}`, 'g');
|
||||
const normalizePath = function normalizePath(filename) {
|
||||
return filename.split(win32.sep).join(posix.sep);
|
||||
return filename.replace(normalizePathRegExp, posix.sep);
|
||||
};
|
||||
|
||||
function getMatcherString(id, resolutionBase) {
|
||||
if (resolutionBase === false || isAbsolute(id) || id.startsWith('*')) {
|
||||
if (resolutionBase === false || isAbsolute(id) || id.startsWith('**')) {
|
||||
return normalizePath(id);
|
||||
}
|
||||
// resolve('') is valid and will default to process.cwd()
|
||||
@@ -328,10 +195,12 @@ const createFilter = function createFilter(include, exclude, options) {
|
||||
};
|
||||
const includeMatchers = ensureArray(include).map(getMatcher);
|
||||
const excludeMatchers = ensureArray(exclude).map(getMatcher);
|
||||
if (!includeMatchers.length && !excludeMatchers.length)
|
||||
return (id) => typeof id === 'string' && !id.includes('\0');
|
||||
return function result(id) {
|
||||
if (typeof id !== 'string')
|
||||
return false;
|
||||
if (/\0/.test(id))
|
||||
if (id.includes('\0'))
|
||||
return false;
|
||||
const pathId = normalizePath(id);
|
||||
for (let i = 0; i < excludeMatchers.length; ++i) {
|
||||
@@ -407,6 +276,7 @@ function serialize(obj, indent, baseIndent) {
|
||||
}
|
||||
if (typeof obj === 'symbol') {
|
||||
const key = Symbol.keyFor(obj);
|
||||
// eslint-disable-next-line no-undefined
|
||||
if (key !== undefined)
|
||||
return `Symbol.for(${stringify(key)})`;
|
||||
}
|
||||
@@ -414,7 +284,17 @@ function serialize(obj, indent, baseIndent) {
|
||||
return `${obj}n`;
|
||||
return stringify(obj);
|
||||
}
|
||||
// isWellFormed exists from Node.js 20
|
||||
const hasStringIsWellFormed = 'isWellFormed' in String.prototype;
|
||||
function isWellFormedString(input) {
|
||||
// @ts-expect-error String::isWellFormed exists from ES2024. tsconfig lib is set to ES6
|
||||
if (hasStringIsWellFormed)
|
||||
return input.isWellFormed();
|
||||
// https://github.com/tc39/proposal-is-usv-string/blob/main/README.md#algorithm
|
||||
return !/\p{Surrogate}/u.test(input);
|
||||
}
|
||||
const dataToEsm = function dataToEsm(data, options = {}) {
|
||||
var _a, _b;
|
||||
const t = options.compact ? '' : 'indent' in options ? options.indent : '\t';
|
||||
const _ = options.compact ? '' : ' ';
|
||||
const n = options.compact ? '' : '\n';
|
||||
@@ -429,8 +309,17 @@ const dataToEsm = function dataToEsm(data, options = {}) {
|
||||
const magic = _ || (/^[{[\-\/]/.test(code) ? '' : ' '); // eslint-disable-line no-useless-escape
|
||||
return `export default${magic}${code};`;
|
||||
}
|
||||
let maxUnderbarPrefixLength = 0;
|
||||
for (const key of Object.keys(data)) {
|
||||
const underbarPrefixLength = (_b = (_a = /^(_+)/.exec(key)) === null || _a === void 0 ? void 0 : _a[0].length) !== null && _b !== void 0 ? _b : 0;
|
||||
if (underbarPrefixLength > maxUnderbarPrefixLength) {
|
||||
maxUnderbarPrefixLength = underbarPrefixLength;
|
||||
}
|
||||
}
|
||||
const arbitraryNamePrefix = `${'_'.repeat(maxUnderbarPrefixLength + 1)}arbitrary`;
|
||||
let namedExportCode = '';
|
||||
const defaultExportRows = [];
|
||||
const arbitraryNameExportRows = [];
|
||||
for (const [key, value] of Object.entries(data)) {
|
||||
if (key === makeLegalIdentifier(key)) {
|
||||
if (options.objectShorthand)
|
||||
@@ -441,9 +330,18 @@ const dataToEsm = function dataToEsm(data, options = {}) {
|
||||
}
|
||||
else {
|
||||
defaultExportRows.push(`${stringify(key)}:${_}${serialize(value, options.compact ? null : t, '')}`);
|
||||
if (options.includeArbitraryNames && isWellFormedString(key)) {
|
||||
const variableName = `${arbitraryNamePrefix}${arbitraryNameExportRows.length}`;
|
||||
namedExportCode += `${declarationType} ${variableName}${_}=${_}${serialize(value, options.compact ? null : t, '')};${n}`;
|
||||
arbitraryNameExportRows.push(`${variableName} as ${JSON.stringify(key)}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
return `${namedExportCode}export default${_}{${n}${t}${defaultExportRows.join(`,${n}${t}`)}${n}};${n}`;
|
||||
const arbitraryExportCode = arbitraryNameExportRows.length > 0
|
||||
? `export${_}{${n}${t}${arbitraryNameExportRows.join(`,${n}${t}`)}${n}};${n}`
|
||||
: '';
|
||||
const defaultExportCode = `export default${_}{${n}${t}${defaultExportRows.join(`,${n}${t}`)}${n}};${n}`;
|
||||
return `${namedExportCode}${arbitraryExportCode}${defaultExportCode}`;
|
||||
};
|
||||
|
||||
// TODO: remove this in next major
|
||||
@@ -458,3 +356,4 @@ var index = {
|
||||
};
|
||||
|
||||
export { addExtension, attachScopes, createFilter, dataToEsm, index as default, extractAssignedNames, makeLegalIdentifier, normalizePath };
|
||||
//# sourceMappingURL=index.js.map
|
||||
|
||||
Reference in New Issue
Block a user