@qubit-ltd/rollup-builder 1.8.8 → 1.8.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/rollup-builder.cjs +26 -26
- package/dist/rollup-builder.cjs.map +1 -1
- package/dist/rollup-builder.min.cjs.map +1 -1
- package/dist/rollup-builder.min.mjs.map +1 -1
- package/dist/rollup-builder.mjs +26 -26
- package/dist/rollup-builder.mjs.map +1 -1
- package/doc/api/global.html +1 -1
- package/doc/api/index.html +1 -1
- package/doc/rollup-builder.min.visualization.html +1 -1
- package/doc/rollup-builder.visualization.html +1 -1
- package/package.json +15 -13
package/dist/rollup-builder.cjs
CHANGED
|
@@ -14,7 +14,7 @@ var analyzer = require('rollup-plugin-analyzer');
|
|
|
14
14
|
var rollupPluginVisualizer = require('rollup-plugin-visualizer');
|
|
15
15
|
|
|
16
16
|
function _createForOfIteratorHelper$1(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$1(r)) || e) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: true } : { done: false, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = true, u = false; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = true, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
17
|
-
function _unsupportedIterableToArray$1(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$1(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$1(r, a) :
|
|
17
|
+
function _unsupportedIterableToArray$1(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$1(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$1(r, a) : void 0; } }
|
|
18
18
|
function _arrayLikeToArray$1(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
19
19
|
|
|
20
20
|
/**
|
|
@@ -48,7 +48,7 @@ function getRollupExternal(importMetaUrl, options) {
|
|
|
48
48
|
}
|
|
49
49
|
var peerPattern = peers ? new RegExp("^(".concat(peers.join('|'), ")($|/)")) : null;
|
|
50
50
|
// gets the additional external packages from the user passed options
|
|
51
|
-
var additions = (_options$externals = options.externals) !== null && _options$externals !==
|
|
51
|
+
var additions = (_options$externals = options.externals) !== null && _options$externals !== void 0 ? _options$externals : [];
|
|
52
52
|
// save some configuration to the options object
|
|
53
53
|
options.peers = peers;
|
|
54
54
|
options.peerPattern = peerPattern;
|
|
@@ -103,7 +103,7 @@ function getRollupOutput(format, libraryName, options) {
|
|
|
103
103
|
var _options$exports, _options$nodeEnv, _options$minify, _options$filenamePref, _options$outputDir, _options$sourcemap;
|
|
104
104
|
var filenameExt = '';
|
|
105
105
|
var footer = '';
|
|
106
|
-
var exports = (_options$exports = options.exports) !== null && _options$exports !==
|
|
106
|
+
var exports = (_options$exports = options.exports) !== null && _options$exports !== void 0 ? _options$exports : 'auto';
|
|
107
107
|
switch (format) {
|
|
108
108
|
case 'cjs': // drop down
|
|
109
109
|
case 'umd':
|
|
@@ -183,16 +183,16 @@ function getRollupOutput(format, libraryName, options) {
|
|
|
183
183
|
default:
|
|
184
184
|
throw new Error("Unsupported library format: ".concat(format));
|
|
185
185
|
}
|
|
186
|
-
var nodeEnv = (_options$nodeEnv = options.nodeEnv) !== null && _options$nodeEnv !==
|
|
187
|
-
var minify = (_options$minify = options.minify) !== null && _options$minify !==
|
|
186
|
+
var nodeEnv = (_options$nodeEnv = options.nodeEnv) !== null && _options$nodeEnv !== void 0 ? _options$nodeEnv : process.env.NODE_ENV;
|
|
187
|
+
var minify = (_options$minify = options.minify) !== null && _options$minify !== void 0 ? _options$minify : nodeEnv === 'production';
|
|
188
188
|
var camelCaseToDashCase = function camelCaseToDashCase(s) {
|
|
189
189
|
return s.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
|
|
190
190
|
};
|
|
191
|
-
var filenamePrefix = (_options$filenamePref = options.filenamePrefix) !== null && _options$filenamePref !==
|
|
191
|
+
var filenamePrefix = (_options$filenamePref = options.filenamePrefix) !== null && _options$filenamePref !== void 0 ? _options$filenamePref : camelCaseToDashCase(libraryName);
|
|
192
192
|
var filenameBase = "".concat(filenamePrefix).concat(minify ? '.min' : '');
|
|
193
193
|
var filename = "".concat(filenameBase).concat(filenameExt);
|
|
194
|
-
var outputDir = (_options$outputDir = options.outputDir) !== null && _options$outputDir !==
|
|
195
|
-
var sourcemap = (_options$sourcemap = options.sourcemap) !== null && _options$sourcemap !==
|
|
194
|
+
var outputDir = (_options$outputDir = options.outputDir) !== null && _options$outputDir !== void 0 ? _options$outputDir : 'dist';
|
|
195
|
+
var sourcemap = (_options$sourcemap = options.sourcemap) !== null && _options$sourcemap !== void 0 ? _options$sourcemap : true;
|
|
196
196
|
// save some configuration to the options object
|
|
197
197
|
options.format = format;
|
|
198
198
|
options.name = libraryName;
|
|
@@ -242,11 +242,11 @@ function getRollupOutput(format, libraryName, options) {
|
|
|
242
242
|
*/
|
|
243
243
|
function configAliasPlugin(format, importMetaUrl, options, plugins) {
|
|
244
244
|
var _options$useAliasPlug;
|
|
245
|
-
if ((_options$useAliasPlug = options.useAliasPlugin) !== null && _options$useAliasPlug !==
|
|
245
|
+
if ((_options$useAliasPlug = options.useAliasPlugin) !== null && _options$useAliasPlug !== void 0 ? _options$useAliasPlug : true) {
|
|
246
246
|
var _options$aliasPluginO;
|
|
247
247
|
// The @rollup/plugin-alias enables us to use absolute import paths for
|
|
248
248
|
// "src" (or any other path you want to configure).
|
|
249
|
-
var pluginOptions = (_options$aliasPluginO = options.aliasPluginOptions) !== null && _options$aliasPluginO !==
|
|
249
|
+
var pluginOptions = (_options$aliasPluginO = options.aliasPluginOptions) !== null && _options$aliasPluginO !== void 0 ? _options$aliasPluginO : {
|
|
250
250
|
entries: {
|
|
251
251
|
'src': node_url.fileURLToPath(new URL('src', importMetaUrl))
|
|
252
252
|
}
|
|
@@ -289,11 +289,11 @@ function configAliasPlugin(format, importMetaUrl, options, plugins) {
|
|
|
289
289
|
*/
|
|
290
290
|
function configNodeResolvePlugin(format, importMetaUrl, options, plugins) {
|
|
291
291
|
var _options$useNodeResol;
|
|
292
|
-
if ((_options$useNodeResol = options.useNodeResolvePlugin) !== null && _options$useNodeResol !==
|
|
292
|
+
if ((_options$useNodeResol = options.useNodeResolvePlugin) !== null && _options$useNodeResol !== void 0 ? _options$useNodeResol : true) {
|
|
293
293
|
var _options$nodeResolveP;
|
|
294
294
|
// The @rollup/plugin-node-resolve allows Rollup to resolve external
|
|
295
295
|
// modules from node_modules:
|
|
296
|
-
var pluginOptions = (_options$nodeResolveP = options.nodeResolvePluginOptions) !== null && _options$nodeResolveP !==
|
|
296
|
+
var pluginOptions = (_options$nodeResolveP = options.nodeResolvePluginOptions) !== null && _options$nodeResolveP !== void 0 ? _options$nodeResolveP : {};
|
|
297
297
|
if (options.debug === true) {
|
|
298
298
|
console.debug('[DEBUG] The @rollup/plugin-node-resolve plugin options are:');
|
|
299
299
|
console.dir(pluginOptions, {
|
|
@@ -332,7 +332,7 @@ function configNodeResolvePlugin(format, importMetaUrl, options, plugins) {
|
|
|
332
332
|
*/
|
|
333
333
|
function configCommonJsPlugin(format, importMetaUrl, options, plugins) {
|
|
334
334
|
var _options$useCommonjsP;
|
|
335
|
-
if ((_options$useCommonjsP = options.useCommonjsPlugin) !== null && _options$useCommonjsP !==
|
|
335
|
+
if ((_options$useCommonjsP = options.useCommonjsPlugin) !== null && _options$useCommonjsP !== void 0 ? _options$useCommonjsP : true) {
|
|
336
336
|
var _options$commonjsPlug;
|
|
337
337
|
// The @rollup/plugin-commonjs plugin converts 3rd-party CommonJS modules
|
|
338
338
|
// into ES6 code, so that they can be included in our Rollup bundle.
|
|
@@ -340,7 +340,7 @@ function configCommonJsPlugin(format, importMetaUrl, options, plugins) {
|
|
|
340
340
|
// same Rollup configuration, it's important to note that
|
|
341
341
|
// @rollup/plugin-commonjs must be placed before this plugin in the
|
|
342
342
|
// plugins array for the two to work together properly.
|
|
343
|
-
var pluginOptions = (_options$commonjsPlug = options.commonjsPluginOptions) !== null && _options$commonjsPlug !==
|
|
343
|
+
var pluginOptions = (_options$commonjsPlug = options.commonjsPluginOptions) !== null && _options$commonjsPlug !== void 0 ? _options$commonjsPlug : {
|
|
344
344
|
include: ['node_modules/**']
|
|
345
345
|
};
|
|
346
346
|
if (options.debug === true) {
|
|
@@ -381,9 +381,9 @@ function configCommonJsPlugin(format, importMetaUrl, options, plugins) {
|
|
|
381
381
|
*/
|
|
382
382
|
function configBabelPlugin(format, importMetaUrl, options, plugins) {
|
|
383
383
|
var _options$useBabelPlug;
|
|
384
|
-
if ((_options$useBabelPlug = options.useBabelPlugin) !== null && _options$useBabelPlug !==
|
|
384
|
+
if ((_options$useBabelPlug = options.useBabelPlugin) !== null && _options$useBabelPlug !== void 0 ? _options$useBabelPlug : true) {
|
|
385
385
|
var _options$babelPluginO;
|
|
386
|
-
var pluginOptions = (_options$babelPluginO = options.babelPluginOptions) !== null && _options$babelPluginO !==
|
|
386
|
+
var pluginOptions = (_options$babelPluginO = options.babelPluginOptions) !== null && _options$babelPluginO !== void 0 ? _options$babelPluginO : {
|
|
387
387
|
babelHelpers: 'runtime',
|
|
388
388
|
exclude: ['node_modules/**'],
|
|
389
389
|
presets: [
|
|
@@ -432,12 +432,12 @@ function configBabelPlugin(format, importMetaUrl, options, plugins) {
|
|
|
432
432
|
*/
|
|
433
433
|
function configTerserPlugin(format, importMetaUrl, options, plugins) {
|
|
434
434
|
var _options$nodeEnv, _options$minify;
|
|
435
|
-
var nodeEnv = (_options$nodeEnv = options.nodeEnv) !== null && _options$nodeEnv !==
|
|
436
|
-
var minify = (_options$minify = options.minify) !== null && _options$minify !==
|
|
435
|
+
var nodeEnv = (_options$nodeEnv = options.nodeEnv) !== null && _options$nodeEnv !== void 0 ? _options$nodeEnv : process.env.NODE_ENV;
|
|
436
|
+
var minify = (_options$minify = options.minify) !== null && _options$minify !== void 0 ? _options$minify : nodeEnv === 'production';
|
|
437
437
|
if (minify) {
|
|
438
438
|
var _options$terserPlugin;
|
|
439
439
|
// The @rollup/plugin-terser uses terser under the hood to minify the code.
|
|
440
|
-
var pluginOptions = (_options$terserPlugin = options.terserPluginOptions) !== null && _options$terserPlugin !==
|
|
440
|
+
var pluginOptions = (_options$terserPlugin = options.terserPluginOptions) !== null && _options$terserPlugin !== void 0 ? _options$terserPlugin : {
|
|
441
441
|
output: {
|
|
442
442
|
comments: false // default to remove all comments
|
|
443
443
|
},
|
|
@@ -483,11 +483,11 @@ function configTerserPlugin(format, importMetaUrl, options, plugins) {
|
|
|
483
483
|
*/
|
|
484
484
|
function configAnalyzerPlugin(format, importMetaUrl, options, plugins) {
|
|
485
485
|
var _options$useAnalyzerP;
|
|
486
|
-
if ((_options$useAnalyzerP = options.useAnalyzerPlugin) !== null && _options$useAnalyzerP !==
|
|
486
|
+
if ((_options$useAnalyzerP = options.useAnalyzerPlugin) !== null && _options$useAnalyzerP !== void 0 ? _options$useAnalyzerP : true) {
|
|
487
487
|
var _options$analyzerPlug;
|
|
488
488
|
// The rollup-plugin-analyzer will print out some useful info about our
|
|
489
489
|
// generated bundle upon successful builds.
|
|
490
|
-
var pluginOptions = (_options$analyzerPlug = options.analyzerPluginOptions) !== null && _options$analyzerPlug !==
|
|
490
|
+
var pluginOptions = (_options$analyzerPlug = options.analyzerPluginOptions) !== null && _options$analyzerPlug !== void 0 ? _options$analyzerPlug : {
|
|
491
491
|
hideDeps: true,
|
|
492
492
|
limit: 0,
|
|
493
493
|
summaryOnly: true
|
|
@@ -533,11 +533,11 @@ function configAnalyzerPlugin(format, importMetaUrl, options, plugins) {
|
|
|
533
533
|
*/
|
|
534
534
|
function configVisualizerPlugin(format, importMetaUrl, options, plugins) {
|
|
535
535
|
var _options$useVisualize;
|
|
536
|
-
if ((_options$useVisualize = options.useVisualizerPlugin) !== null && _options$useVisualize !==
|
|
536
|
+
if ((_options$useVisualize = options.useVisualizerPlugin) !== null && _options$useVisualize !== void 0 ? _options$useVisualize : true) {
|
|
537
537
|
var _options$visualizerPl;
|
|
538
538
|
// The rollup-plugin-visualizer will visualize and analyze your Rollup
|
|
539
539
|
// bundle to see which modules are taking up space.
|
|
540
|
-
var pluginOptions = (_options$visualizerPl = options.visualizerPluginOptions) !== null && _options$visualizerPl !==
|
|
540
|
+
var pluginOptions = (_options$visualizerPl = options.visualizerPluginOptions) !== null && _options$visualizerPl !== void 0 ? _options$visualizerPl : {
|
|
541
541
|
filename: "./doc/".concat(options.filenameBase, ".visualization.html"),
|
|
542
542
|
gzipSize: true,
|
|
543
543
|
brotliSize: true
|
|
@@ -609,7 +609,7 @@ function getRollupOnWarn() {
|
|
|
609
609
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
610
610
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
611
611
|
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: true } : { done: false, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = true, u = false; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = true, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
612
|
-
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) :
|
|
612
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
613
613
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
614
614
|
|
|
615
615
|
/**
|
|
@@ -738,9 +738,9 @@ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length)
|
|
|
738
738
|
function rollupBuilder(libraryName, importMetaUrl) {
|
|
739
739
|
var _options$formats, _options$input;
|
|
740
740
|
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
741
|
-
var formats = (_options$formats = options.formats) !== null && _options$formats !==
|
|
741
|
+
var formats = (_options$formats = options.formats) !== null && _options$formats !== void 0 ? _options$formats : ['cjs', 'esm'];
|
|
742
742
|
var result = [];
|
|
743
|
-
var input = (_options$input = options.input) !== null && _options$input !==
|
|
743
|
+
var input = (_options$input = options.input) !== null && _options$input !== void 0 ? _options$input : 'src/index.js';
|
|
744
744
|
var _iterator = _createForOfIteratorHelper(formats),
|
|
745
745
|
_step;
|
|
746
746
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rollup-builder.cjs","sources":["../src/get-rollup-external.mjs","../src/get-rollup-output.mjs","../src/plugins/config-alias-plugin.mjs","../src/plugins/config-node-resolve-plugin.mjs","../src/plugins/config-common-js-plugin.mjs","../src/plugins/config-babel-plugin.mjs","../src/plugins/config-terser-plugin.mjs","../src/plugins/config-analyzer-plugin.mjs","../src/plugins/config-visualizer-plugin.mjs","../src/get-rollup-plugins.mjs","../src/get-rollup-on-warn.mjs","../src/rollup-builder.mjs","../src/index.mjs"],"sourcesContent":["////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport { createRequire } from 'node:module';\n\n/**\n * Gets Rollup `external` configuration.\n *\n * @param {string} importMetaUrl\n * The URL of the `import.meta` of the caller module.\n * @param {object} options\n * The additional options for building the library.\n * @returns {function}\n * The predicate used as the Rollup `external` configuration for the library.\n * @author Haixing Hu\n */\nfunction getRollupExternal(importMetaUrl, options) {\n if (!importMetaUrl) {\n throw new Error('importMetaUrl is required');\n }\n if (!options) {\n throw new Error('options is required');\n }\n // gets all peerDependencies packages from 'package.json' of the caller module\n const require = createRequire(importMetaUrl);\n const pkg = require('./package.json');\n const peers = [...Object.keys(pkg.peerDependencies || {})];\n if (!Array.isArray(peers)) {\n throw new Error('peerDependencies should be an array');\n }\n if (peers.length === 0) {\n return [];\n }\n const peerPattern = (peers ? new RegExp(`^(${peers.join('|')})($|/)`) : null);\n // gets the additional external packages from the user passed options\n const additions = options.externals ?? [];\n // save some configuration to the options object\n options.peers = peers;\n options.peerPattern = peerPattern;\n return (id) => {\n if (peerPattern && peerPattern.test(id)) {\n return true;\n }\n for (const pattern of additions) {\n if ((pattern instanceof RegExp) && pattern.test(id)) {\n return true;\n }\n if (((typeof pattern === 'string') || (pattern instanceof String)) && (pattern === id)) {\n return true;\n }\n }\n return false;\n };\n}\n\nexport default getRollupExternal;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * Gets the Rollup `output` configuration.\n *\n * @param {string} format\n * The format of the library.\n * @param {string} libraryName\n * The name of the library.\n * @param {object} options\n * The additional options for building the library.\n * @returns {object}\n * The Rollup output configuration for the library.\n * @author Haixing Hu\n */\nfunction getRollupOutput(format, libraryName, options) {\n let filenameExt = '';\n let footer = '';\n let exports = options.exports ?? 'auto';\n switch (format) {\n case 'cjs': // drop down\n case 'umd': // drop down\n filenameExt = (format === 'cjs' ? '.cjs' : `.${format}.js`);\n // The following workaround is to solve the following issue: If an ESM\n // module has both default export and named exports, the rollup cannot\n // handle it correctly. For example, the following is a source ESM module:\n // ```js\n // export { Foo, Bar };\n // export default Foo;\n // ```\n // The rollup will translate it into the following codes:\n // ```js\n // exports.Foo = Foo;\n // exports.Bar = Bar;\n // exports.default = Foo;\n // ```\n // However, a common-js consumer will use the module as follows:\n // ```js\n // const Foo = require('my-module');\n // ```\n // which will cause an error. The correct usage should be\n // ```js\n // const Foo = require('my-module').default\n // ```\n // But unfortunately, the rollup will translate the ESM default import as\n // follows:\n // ```js\n // import Foo from 'my-module';\n // ```\n // will be translated by rollup to\n // ```js\n // const Foo = require('my-module');\n // ```\n // Note that the above translation has no `.default` suffix, which will\n // cause an error.\n //\n // The workaround is copied from the source code of the official rollup\n // plugins:\n // https://github.com/rollup/plugins/blob/master/shared/rollup.config.mjs\n //\n // It adds a simple footer statements to each `CJS` format bundle:\n // ```js\n // module.exports = Object.assign(exports.default, exports);\n // ```\n //\n // See:\n // [1] https://rollupjs.org/configuration-options/#output-exports\n // [2] https://github.com/rollup/rollup/issues/1961\n // [3] https://stackoverflow.com/questions/58246998/mixing-default-and-named-exports-with-rollup\n // [4] https://github.com/avisek/rollup-patch-seamless-default-export\n // [5] https://github.com/rollup/plugins/blob/master/shared/rollup.config.mjs\n //\n if (exports === 'mixed') {\n exports = 'named';\n footer = 'module.exports = Object.assign(exports.default, exports);';\n }\n break;\n case 'amd': // drop down\n case 'iife':\n filenameExt = `.${format}.js`;\n if (exports === 'mixed') {\n exports = 'auto';\n }\n break;\n case 'es': // drop down\n case 'esm': // drop down\n case 'module':\n format = 'es';\n filenameExt = '.mjs';\n // fix the exports, because the ESM format does not support the 'mixed' exports mode\n if (exports === 'mixed') {\n exports = 'auto';\n }\n break;\n default:\n throw new Error(`Unsupported library format: ${format}`);\n }\n const nodeEnv = options.nodeEnv ?? process.env.NODE_ENV;\n const minify = options.minify ?? (nodeEnv === 'production');\n const camelCaseToDashCase = (s) => s.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n const filenamePrefix = options.filenamePrefix ?? camelCaseToDashCase(libraryName);\n const filenameBase = `${filenamePrefix}${minify ? '.min' : ''}`;\n const filename = `${filenameBase}${filenameExt}`;\n const outputDir = options.outputDir ?? 'dist';\n const sourcemap = options.sourcemap ?? true;\n // save some configuration to the options object\n options.format = format;\n options.name = libraryName;\n options.minify = minify;\n options.filenamePrefix = filenamePrefix;\n options.filenameBase = filenameBase;\n options.filenameExt = filenameExt;\n options.filename = filename;\n options.exports = exports;\n options.sourcemap = sourcemap;\n options.outputDir = outputDir;\n return {\n name: libraryName,\n file: `${outputDir}/${filename}`,\n format,\n exports,\n footer,\n sourcemap,\n compact: minify,\n };\n}\n\nexport default getRollupOutput;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport { fileURLToPath } from 'node:url';\nimport alias from '@rollup/plugin-alias';\n\n/**\n * Configures the `@rollup/plugin-alias` plugin.\n *\n * @param {string} format\n * The format of the library.\n * @param {string} importMetaUrl\n * The URL of the `import.meta` of the caller module.\n * @param {object} options\n * The additional options for building the library.\n * @param {Array<Object>} plugins\n * The Rollup plugins array.\n * @returns {Array<Object>}\n * The modified Rollup plugins array.\n * @author Haixing Hu\n * @see https://www.npmjs.com/package/@rollup/plugin-alias\n */\nfunction configAliasPlugin(format, importMetaUrl, options, plugins) {\n if (options.useAliasPlugin ?? true) {\n // The @rollup/plugin-alias enables us to use absolute import paths for\n // \"src\" (or any other path you want to configure).\n const pluginOptions = options.aliasPluginOptions ?? {\n entries: {\n 'src': fileURLToPath(new URL('src', importMetaUrl)),\n },\n };\n if (options.debug === true) {\n console.debug('[DEBUG] The @rollup/plugin-alias plugin options are:');\n console.dir(pluginOptions, { depth: null });\n }\n plugins.push(alias(pluginOptions));\n }\n return plugins;\n}\n\nexport default configAliasPlugin;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport nodeResolve from '@rollup/plugin-node-resolve';\n\n/**\n * Configures the `@rollup/plugin-node-resolve` plugin.\n *\n * @param {string} format\n * The format of the library.\n * @param {string} importMetaUrl\n * The URL of the `import.meta` of the caller module.\n * @param {object} options\n * The additional options for building the library.\n * @param {Array<Object>} plugins\n * The Rollup plugins array.\n * @returns {Array<Object>}\n * The modified Rollup plugins array.\n * @author Haixing Hu\n * @see https://www.npmjs.com/package/@rollup/plugin-node-resolve\n */\nfunction configNodeResolvePlugin(format, importMetaUrl, options, plugins) {\n if (options.useNodeResolvePlugin ?? true) {\n // The @rollup/plugin-node-resolve allows Rollup to resolve external\n // modules from node_modules:\n const pluginOptions = options.nodeResolvePluginOptions ?? {};\n if (options.debug === true) {\n console.debug('[DEBUG] The @rollup/plugin-node-resolve plugin options are:');\n console.dir(pluginOptions, { depth: null });\n }\n plugins.push(nodeResolve(pluginOptions));\n }\n return plugins;\n}\n\nexport default configNodeResolvePlugin;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport commonjs from '@rollup/plugin-commonjs';\n\n/**\n * Configures the `@rollup/plugin-commonjs` plugin.\n *\n * @param {string} format\n * The format of the library.\n * @param {string} importMetaUrl\n * The URL of the `import.meta` of the caller module.\n * @param {object} options\n * The additional options for building the library.\n * @param {Array<Object>} plugins\n * The Rollup plugins array.\n * @returns {Array<Object>}\n * The modified Rollup plugins array.\n * @author Haixing Hu\n * @see https://www.npmjs.com/package/@rollup/plugin-commonjs\n */\nfunction configCommonJsPlugin(format, importMetaUrl, options, plugins) {\n if (options.useCommonjsPlugin ?? true) {\n // The @rollup/plugin-commonjs plugin converts 3rd-party CommonJS modules\n // into ES6 code, so that they can be included in our Rollup bundle.\n // When using @rollup/plugin-babel with @rollup/plugin-commonjs in the\n // same Rollup configuration, it's important to note that\n // @rollup/plugin-commonjs must be placed before this plugin in the\n // plugins array for the two to work together properly.\n const pluginOptions = options.commonjsPluginOptions ?? {\n include: ['node_modules/**'],\n };\n if (options.debug === true) {\n console.debug('[DEBUG] The @rollup/plugin-commonjs plugin options are:');\n console.dir(pluginOptions, { depth: null });\n }\n plugins.push(commonjs(pluginOptions));\n }\n return plugins;\n}\n\nexport default configCommonJsPlugin;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport babel from '@rollup/plugin-babel';\n\n/**\n * Configures the `@rollup/plugin-babel` plugin.\n *\n * @param {string} format\n * The format of the library.\n * @param {string} importMetaUrl\n * The URL of the `import.meta` of the caller module.\n * @param {object} options\n * The additional options for building the library.\n * @param {Array} plugins\n * The array of Rollup plugins.\n * @returns {Array<Object>}\n * The modified Rollup plugins array.\n * @author Haixing Hu\n * @see https://www.npmjs.com/package/@rollup/plugin-babel\n */\nfunction configBabelPlugin(format, importMetaUrl, options, plugins) {\n if (options.useBabelPlugin ?? true) {\n const pluginOptions = options.babelPluginOptions ?? {\n babelHelpers: 'runtime',\n exclude: ['node_modules/**'],\n presets: [\n // The @babel/preset-env preset enables Babel to transpile ES6+ code\n // and the rollup requires that Babel keeps ES6 module syntax intact.\n ['@babel/preset-env', { modules: false }],\n ],\n plugins: [\n '@babel/plugin-transform-runtime',\n ],\n };\n if (options.debug === true) {\n console.debug('[DEBUG] The @rollup/plugin-babel plugin options are:');\n console.dir(pluginOptions, { depth: null });\n }\n plugins.push(babel(pluginOptions));\n }\n return plugins;\n}\n\nexport default configBabelPlugin;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport terser from '@rollup/plugin-terser';\n\n/**\n * Configures the `@rollup/plugin-terser` plugin.\n *\n * @param {string} format\n * The format of the library.\n * @param {string} importMetaUrl\n * The URL of the `import.meta` of the caller module.\n * @param {object} options\n * The additional options for building the library.\n * @param {Array} plugins\n * The array of Rollup plugins.\n * @returns {Array<Object>}\n * The modified Rollup plugins array.\n * @author Haixing Hu\n * @see https://www.npmjs.com/package/@rollup/plugin-terser\n */\nfunction configTerserPlugin(format, importMetaUrl, options, plugins) {\n const nodeEnv = options.nodeEnv ?? process.env.NODE_ENV;\n const minify = options.minify ?? (nodeEnv === 'production');\n if (minify) {\n // The @rollup/plugin-terser uses terser under the hood to minify the code.\n const pluginOptions = options.terserPluginOptions ?? {\n output: {\n comments: false, // default to remove all comments\n },\n keep_classnames: true, // keep the class names\n keep_fnames: true, // keep the function names\n };\n if (options.debug === true) {\n console.debug('[DEBUG] The @rollup/plugin-terser plugin options are:');\n console.dir(pluginOptions, { depth: null });\n }\n plugins.push(terser(pluginOptions));\n }\n return plugins;\n}\n\nexport default configTerserPlugin;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport analyzer from 'rollup-plugin-analyzer';\n\n/**\n * Configures the `rollup-plugin-analyzer` plugin.\n *\n * @param {string} format\n * The format of the library.\n * @param {string} importMetaUrl\n * The URL of the `import.meta` of the caller module.\n * @param {object} options\n * The additional options for building the library.\n * @param {Array} plugins\n * The array of Rollup plugins.\n * @returns {Array<Object>}\n * The modified Rollup plugins array.\n * @author Haixing Hu\n * @see https://www.npmjs.com/package/rollup-plugin-analyzer\n */\nfunction configAnalyzerPlugin(format, importMetaUrl, options, plugins) {\n if (options.useAnalyzerPlugin ?? true) {\n // The rollup-plugin-analyzer will print out some useful info about our\n // generated bundle upon successful builds.\n const pluginOptions = options.analyzerPluginOptions ?? {\n hideDeps: true,\n limit: 0,\n summaryOnly: true,\n };\n if (options.debug === true) {\n console.debug('[DEBUG] The rollup-plugin-analyzer plugin options are:');\n console.dir(pluginOptions, { depth: null });\n }\n plugins.push(analyzer(pluginOptions));\n }\n return plugins;\n}\n\nexport default configAnalyzerPlugin;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport { visualizer } from 'rollup-plugin-visualizer';\n\n/**\n * Configures the `rollup-plugin-visualizer` plugin.\n *\n * The `rollup-plugin-visualizer` will visualize and analyze your Rollup\n * bundle to see which modules are taking up space.\n *\n * @param {string} format\n * The format of the library.\n * @param {string} importMetaUrl\n * The URL of the `import.meta` of the caller module.\n * @param {object} options\n * The additional options for building the library.\n * @param {Array} plugins\n * The array of Rollup plugins.\n * @returns {Array<Object>}\n * The modified Rollup plugins array.\n * @author Haixing Hu\n * @see https://www.npmjs.com/package/rollup-plugin-visualizer\n */\nfunction configVisualizerPlugin(format, importMetaUrl, options, plugins) {\n if (options.useVisualizerPlugin ?? true) {\n // The rollup-plugin-visualizer will visualize and analyze your Rollup\n // bundle to see which modules are taking up space.\n const pluginOptions = options.visualizerPluginOptions ?? {\n filename: `./doc/${options.filenameBase}.visualization.html`,\n gzipSize: true,\n brotliSize: true,\n };\n if (options.debug === true) {\n console.debug('[DEBUG] The rollup-plugin-visualizer plugin options are:');\n console.dir(pluginOptions, { depth: null });\n }\n plugins.push(visualizer(pluginOptions));\n }\n return plugins;\n}\n\nexport default configVisualizerPlugin;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport json from '@rollup/plugin-json';\nimport configAliasPlugin from './plugins/config-alias-plugin.mjs';\nimport configNodeResolvePlugin from './plugins/config-node-resolve-plugin.mjs';\nimport configCommonJsPlugin from './plugins/config-common-js-plugin.mjs';\nimport configBabelPlugin from './plugins/config-babel-plugin.mjs';\nimport configTerserPlugin from './plugins/config-terser-plugin.mjs';\nimport configAnalyzerPlugin from './plugins/config-analyzer-plugin.mjs';\nimport configVisualizerPlugin from './plugins/config-visualizer-plugin.mjs';\n\n/**\n * Gets Rollup `plugins` configuration.\n *\n * @param {string} format\n * The format of the library.\n * @param {string} importMetaUrl\n * The URL of the `import.meta` of the caller module.\n * @param {object} options\n * The additional options for building the library.\n * @returns {Array<Object>}\n * The Rollup plugins array.\n * @author Haixing Hu\n */\nfunction getRollupPlugins(format, importMetaUrl, options) {\n const plugins = [];\n plugins.push(json());\n configAliasPlugin(format, importMetaUrl, options, plugins);\n configNodeResolvePlugin(format, importMetaUrl, options, plugins);\n configCommonJsPlugin(format, importMetaUrl, options, plugins);\n configBabelPlugin(format, importMetaUrl, options, plugins);\n configTerserPlugin(format, importMetaUrl, options, plugins);\n configAnalyzerPlugin(format, importMetaUrl, options, plugins);\n configVisualizerPlugin(format, importMetaUrl, options, plugins);\n // The user can specify additional plugins.\n if (options.plugins) {\n plugins.push(...options.plugins);\n }\n return plugins;\n}\n\nexport default getRollupPlugins;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2024.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nfunction getRollupOnWarn() {\n return function onWarn(warning, warn) {\n // skip certain warnings\n if (warning.code === 'INVALID_ANNOTATION'\n && warning.message.includes('#__PURE__')\n && warning.message.includes('terser')) {\n return;\n }\n if (warning.code === 'CIRCULAR_DEPENDENCY'\n && warning.message.includes('node_modules')) {\n return;\n }\n // Use default for everything else\n warn(warning);\n };\n}\n\nexport default getRollupOnWarn;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport getRollupExternal from './get-rollup-external.mjs';\nimport getRollupOutput from './get-rollup-output.mjs';\nimport getRollupPlugins from './get-rollup-plugins.mjs';\nimport getRollupOnWarn from './get-rollup-on-warn.mjs';\n\n/**\n * Builds the Rollup configuration for a library.\n *\n * The function could be provided with an additional options for building the\n * library. It can have the following fields:\n *\n * - `debug: boolean`: whether to print the debug information. If this field is\n * not specified, the default value is `false`.\n * - `formats: [string]`: the array of formats of the library. It can be an\n * array of the following values:\n * - `'cjs'`: the CommonJS format.\n * - `'umd'`: the UMD format.\n * - `'esm'`: the ES module format.\n *\n * If this field is not specified, the default value is `['cjs', 'esm']`.\n * - `exports: string`: the export mode to use. It can be one of the following\n * values:\n * - `'auto'`: automatically guesses your intentions based on what the input\n * module exports.\n * - `'default'`: if you are only exporting one thing using `export default ...`;\n * note that this can cause issues when generating CommonJS output that is\n * meant to be interchangeable with ESM output.\n * - `'named'`: if you are using named exports.\n * - `'none'`: if you are not exporting anything (e.g. you are building an\n * app, not a library)\n * - `'mixed'`: if you are using named exports mixed with a default export.\n * Note that this is not a standard exports mode officially supported by\n * the `rollup`, instead, it is an additional mode add by this library.\n *\n * See [output.exports](https://rollupjs.org/configuration-options/#output-exports)\n * for more details. If this field is not specified, the default value is\n * `'auto'`.\n * - `nodeEnv: string`: the value of the `NODE_ENV` environment variable. If\n * this field is not specified, the default value is `process.env.NODE_ENV`.\n * - `minify: boolean`: whether to minify the code. If this field is not\n * specified, and the `nodeEnv` is `production`, the default value is `true`;\n * otherwise the default value is `false`.\n * - `sourcemap: boolean`: whether to generate the source map. If this field is\n * not specified, the default value is `true`.\n * - `input: string`: the input file of the library. If this field is not\n * specified, the default value is `src/index.js`.\n * - `outputDir: string`: the output directory of the library. If this field is\n * not specified, the default value is `dist`.\n * - `filenamePrefix: string`: the prefix of the output filename. If this field\n * is not specified, the default value is the dash case of the library name.\n * For example, if the library name is `MyLibrary`, the default value of this\n * field is `my-library`.\n * - `externals: [string]`: the array of additional external packages, each can\n * be specified with either a string or a regular expression. If this field is\n * not specified, the default value is an empty array.\n * - `useAliasPlugin: boolean`: whether to use the `@rollup/plugin-alias` plugin.\n * If this field is not specified, the default value is `true`.\n * - `aliasPluginOptions: object`: the options for the `@rollup/plugin-alias`\n * plugin. If this field is not specified, the default value is:\n * ```js\n * {\n * entries: {\n * 'src': fileURLToPath(new URL('src', importMetaUrl)),\n * },\n * }\n * ```\n * - `useNodeResolvePlugin: boolean`: whether to use the `@rollup/plugin-node-resolve`\n * plugin. If this field is not specified, the default value is `true`.\n * - `nodeResolvePluginOptions: object`: the options for the `@rollup/plugin-node-resolve`\n * plugin. If this field is not specified, the default value is: `{}`.\n * - `useCommonjsPlugin: boolean`: whether to use the `@rollup/plugin-commonjs`\n * plugin. If this field is not specified, the default value is `true`.\n * - `commonjsPluginOptions: object`: the options for the `@rollup/plugin-commonjs`\n * plugin. If this field is not specified, the default value is:\n * ```js\n * {\n * include: ['node_modules/**'],\n * }\n * ```\n * - `useBabelPlugin: boolean`: whether to use the `@rollup/plugin-babel` plugin.\n * If this field is not specified, the default value is `true`.\n * - `babelPluginOptions: object`: the options for the `@rollup/plugin-babel`\n * plugin. If this field is not specified, the default value is:\n * ```js\n * {\n * babelHelpers: 'runtime',\n * exclude: ['node_modules/**'],\n * presets: [\n * '@babel/preset-env',\n * ],\n * plugins: [\n * '@babel/plugin-transform-runtime',\n * ],\n * }\n * ```\n * Note that when using the `@rollup/plugin-babel` plugin, you can also specify\n * the configuration of Babel in the standard Babel configuration files,\n * such as `babel.config.js`, `.babelrc`, etc.\n * - `terserOptions: object`: the options for the `@rollup/plugin-terser` plugin.\n * If this field is not specified, the default value is: `{}`. Whether to use\n * the `@rollup/plugin-terser` plugin depends on the `minify` field of the\n * options or the `NODE_ENV` environment variable.\n * - `useAnalyzerPlugin: boolean`: whether to use the `rollup-plugin-analyzer`\n * plugin. If this field is not specified, the default value is `true`.\n * - `analyzerOptions: object`: the options for the `rollup-plugin-analyzer`\n * plugin. If this field is not specified, the default value is:\n * ```js\n * {\n * hideDeps: true,\n * limit: 0,\n * summaryOnly: true,\n * }\n * ```\n * - `plugins: [object]`: the array of configuration of additional Rollup\n * plugins. If this field is not specified, the default value is an empty\n * array.\n *\n * @param {string} libraryName\n * The name of the library, which will be used as the name of the global\n * variable in the UMD format. It should in the camel case.\n * @param {string} importMetaUrl\n * The URL of the `import.meta` of the caller module. It **MUST** be passed\n * with the `import.meta.url` of the caller module.\n * @param {object} options\n * The additional options for building the library, as described above.\n * @returns {Array<object>}\n * the array of Rollup configurations for the library.\n */\nfunction rollupBuilder(libraryName, importMetaUrl, options = {}) {\n const formats = options.formats ?? ['cjs', 'esm'];\n const result = [];\n const input = options.input ?? 'src/index.js';\n for (const format of formats) {\n const clonedOptions = { ...options };\n const output = getRollupOutput(format, libraryName, clonedOptions);\n const external = getRollupExternal(importMetaUrl, clonedOptions);\n const plugins = getRollupPlugins(format, importMetaUrl, clonedOptions);\n const onwarn = getRollupOnWarn();\n const config = { input, output, external, plugins, onwarn };\n result.push(config);\n if (options.debug === true) {\n console.debug(`[DEBUG] The options for the format ${format} is:`);\n console.dir(clonedOptions, { depth: null });\n }\n }\n if (options.debug === true) {\n console.debug('[DEBUG] The generated rollup configurations are:');\n console.dir(result, { depth: null });\n }\n return result;\n}\n\nexport default rollupBuilder;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport rollupBuilder from './rollup-builder.mjs';\n\nexport default rollupBuilder;\n"],"names":["getRollupExternal","importMetaUrl","options","_options$externals","Error","require","createRequire","pkg","peers","_toConsumableArray","Object","keys","peerDependencies","Array","isArray","length","peerPattern","RegExp","concat","join","additions","externals","id","test","_iterator","_createForOfIteratorHelper","_step","s","n","done","pattern","value","String","err","e","f","getRollupOutput","format","libraryName","_options$exports","_options$nodeEnv","_options$minify","_options$filenamePref","_options$outputDir","_options$sourcemap","filenameExt","footer","exports","nodeEnv","process","env","NODE_ENV","minify","camelCaseToDashCase","replace","toLowerCase","filenamePrefix","filenameBase","filename","outputDir","sourcemap","name","file","compact","configAliasPlugin","plugins","_options$useAliasPlug","useAliasPlugin","_options$aliasPluginO","pluginOptions","aliasPluginOptions","entries","fileURLToPath","URL","debug","console","dir","depth","push","alias","configNodeResolvePlugin","_options$useNodeResol","useNodeResolvePlugin","_options$nodeResolveP","nodeResolvePluginOptions","nodeResolve","configCommonJsPlugin","_options$useCommonjsP","useCommonjsPlugin","_options$commonjsPlug","commonjsPluginOptions","include","commonjs","configBabelPlugin","_options$useBabelPlug","useBabelPlugin","_options$babelPluginO","babelPluginOptions","babelHelpers","exclude","presets","modules","babel","configTerserPlugin","_options$terserPlugin","terserPluginOptions","output","comments","keep_classnames","keep_fnames","terser","configAnalyzerPlugin","_options$useAnalyzerP","useAnalyzerPlugin","_options$analyzerPlug","analyzerPluginOptions","hideDeps","limit","summaryOnly","analyzer","configVisualizerPlugin","_options$useVisualize","useVisualizerPlugin","_options$visualizerPl","visualizerPluginOptions","gzipSize","brotliSize","visualizer","getRollupPlugins","json","apply","getRollupOnWarn","onWarn","warning","warn","code","message","includes","rollupBuilder","_options$formats","_options$input","arguments","undefined","formats","result","input","clonedOptions","_objectSpread","external","onwarn","config"],"mappings":";;;;;;;;;;;;;;;;;;;AAUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,iBAAiBA,CAACC,aAAa,EAAEC,OAAO,EAAE;AAAA,EAAA,IAAAC,kBAAA;EACjD,IAAI,CAACF,aAAa,EAAE;AAClB,IAAA,MAAM,IAAIG,KAAK,CAAC,2BAA2B,CAAC;AAC9C;EACA,IAAI,CAACF,OAAO,EAAE;AACZ,IAAA,MAAM,IAAIE,KAAK,CAAC,qBAAqB,CAAC;AACxC;AACA;AACA,EAAA,IAAMC,OAAO,GAAGC,yBAAa,CAACL,aAAa,CAAC;AAC5C,EAAA,IAAMM,GAAG,GAAGF,OAAO,CAAC,gBAAgB,CAAC;AACrC,EAAA,IAAMG,KAAK,GAAAC,kBAAA,CAAOC,MAAM,CAACC,IAAI,CAACJ,GAAG,CAACK,gBAAgB,IAAI,EAAE,CAAC,CAAC;AAC1D,EAAA,IAAI,CAACC,KAAK,CAACC,OAAO,CAACN,KAAK,CAAC,EAAE;AACzB,IAAA,MAAM,IAAIJ,KAAK,CAAC,qCAAqC,CAAC;AACxD;AACA,EAAA,IAAII,KAAK,CAACO,MAAM,KA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EC,OAAO,EAAE+D,OAAO,CAAC;EAC3D8C,oBAAoB,CAAC1E,MAAM,EAAEpC,aAAa,EAAEC,OAAO,EAAE+D,OAAO,CAAC;EAC7DuD,sBAAsB,CAACnF,MAAM,EAAEpC,aAAa,EAAEC,OAAO,EAAE+D,OAAO,CAAC;AAC/D;EACA,IAAI/D,OAAO,CAAC+D,OAAO,EAAE;AACnBA,IAAAA,OAAO,CAACa,IAAI,CAAAoD,KAAA,CAAZjE,OAAO,EAAAxD,kBAAA,CAASP,OAAO,CAAC+D,OAAO,CAAC,CAAA;AAClC;AACA,EAAA,OAAOA,OAAO;AAChB;;AC7CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASkE,eAAeA,GAAG;AACzB,EAAA,OAAO,SAASC,MAAMA,CAACC,OAAO,EAAEC,IAAI,EAAE;AACpC;IACA,IAAID,OAAO,CAACE,IAAI,KAAK,oBAAoB,IAClCF,OAAO,CAACG,OAAO,CAACC,QAAQ,CAAC,WAAW,CAAC,IACrCJ,OAAO,CAACG,OAAO,CAACC,QAAQ,CAAC,QAAQ,CAAC,EAAE;AACzC,MAAA;AACF;AACA,IAAA,IAAIJ,OAAO,CAACE,IAAI,KAAK,qBAAqB,IACnCF,OAAO,CAACG,OAAO,CAACC,QAAQ,CAAC,cAAc,CAAC,EAAE;AAC/C,MAAA;AACF;AACA;IACAH,IAAI,CAACD,OAAO,CAAC;GACd;AACH;;;;;;;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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../src/get-rollup-external.mjs","../src/get-rollup-output.mjs","../src/plugins/config-alias-plugin.mjs","../src/plugins/config-node-resolve-plugin.mjs","../src/plugins/config-common-js-plugin.mjs","../src/plugins/config-babel-plugin.mjs","../src/plugins/config-terser-plugin.mjs","../src/plugins/config-analyzer-plugin.mjs","../src/plugins/config-visualizer-plugin.mjs","../src/get-rollup-plugins.mjs","../src/get-rollup-on-warn.mjs","../src/rollup-builder.mjs","../src/index.mjs"],"sourcesContent":["////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport { createRequire } from 'node:module';\n\n/**\n * Gets Rollup `external` configuration.\n *\n * @param {string} importMetaUrl\n * The URL of the `import.meta` of the caller module.\n * @param {object} options\n * The additional options for building the library.\n * @returns {function}\n * The predicate used as the Rollup `external` configuration for the library.\n * @author Haixing Hu\n */\nfunction getRollupExternal(importMetaUrl, options) {\n if (!importMetaUrl) {\n throw new Error('importMetaUrl is required');\n }\n if (!options) {\n throw new Error('options is required');\n }\n // gets all peerDependencies packages from 'package.json' of the caller module\n const require = createRequire(importMetaUrl);\n const pkg = require('./package.json');\n const peers = [...Object.keys(pkg.peerDependencies || {})];\n if (!Array.isArray(peers)) {\n throw new Error('peerDependencies should be an array');\n }\n if (peers.length === 0) {\n return [];\n }\n const peerPattern = (peers ? new RegExp(`^(${peers.join('|')})($|/)`) : null);\n // gets the additional external packages from the user passed options\n const additions = options.externals ?? [];\n // save some configuration to the options object\n options.peers = peers;\n options.peerPattern = peerPattern;\n return (id) => {\n if (peerPattern && peerPattern.test(id)) {\n return true;\n }\n for (const pattern of additions) {\n if ((pattern instanceof RegExp) && pattern.test(id)) {\n return true;\n }\n if (((typeof pattern === 'string') || (pattern instanceof String)) && (pattern === id)) {\n return true;\n }\n }\n return false;\n };\n}\n\nexport default getRollupExternal;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * Gets the Rollup `output` configuration.\n *\n * @param {string} format\n * The format of the library.\n * @param {string} libraryName\n * The name of the library.\n * @param {object} options\n * The additional options for building the library.\n * @returns {object}\n * The Rollup output configuration for the library.\n * @author Haixing Hu\n */\nfunction getRollupOutput(format, libraryName, options) {\n let filenameExt = '';\n let footer = '';\n let exports = options.exports ?? 'auto';\n switch (format) {\n case 'cjs': // drop down\n case 'umd': // drop down\n filenameExt = (format === 'cjs' ? '.cjs' : `.${format}.js`);\n // The following workaround is to solve the following issue: If an ESM\n // module has both default export and named exports, the rollup cannot\n // handle it correctly. For example, the following is a source ESM module:\n // ```js\n // export { Foo, Bar };\n // export default Foo;\n // ```\n // The rollup will translate it into the following codes:\n // ```js\n // exports.Foo = Foo;\n // exports.Bar = Bar;\n // exports.default = Foo;\n // ```\n // However, a common-js consumer will use the module as follows:\n // ```js\n // const Foo = require('my-module');\n // ```\n // which will cause an error. The correct usage should be\n // ```js\n // const Foo = require('my-module').default\n // ```\n // But unfortunately, the rollup will translate the ESM default import as\n // follows:\n // ```js\n // import Foo from 'my-module';\n // ```\n // will be translated by rollup to\n // ```js\n // const Foo = require('my-module');\n // ```\n // Note that the above translation has no `.default` suffix, which will\n // cause an error.\n //\n // The workaround is copied from the source code of the official rollup\n // plugins:\n // https://github.com/rollup/plugins/blob/master/shared/rollup.config.mjs\n //\n // It adds a simple footer statements to each `CJS` format bundle:\n // ```js\n // module.exports = Object.assign(exports.default, exports);\n // ```\n //\n // See:\n // [1] https://rollupjs.org/configuration-options/#output-exports\n // [2] https://github.com/rollup/rollup/issues/1961\n // [3] https://stackoverflow.com/questions/58246998/mixing-default-and-named-exports-with-rollup\n // [4] https://github.com/avisek/rollup-patch-seamless-default-export\n // [5] https://github.com/rollup/plugins/blob/master/shared/rollup.config.mjs\n //\n if (exports === 'mixed') {\n exports = 'named';\n footer = 'module.exports = Object.assign(exports.default, exports);';\n }\n break;\n case 'amd': // drop down\n case 'iife':\n filenameExt = `.${format}.js`;\n if (exports === 'mixed') {\n exports = 'auto';\n }\n break;\n case 'es': // drop down\n case 'esm': // drop down\n case 'module':\n format = 'es';\n filenameExt = '.mjs';\n // fix the exports, because the ESM format does not support the 'mixed' exports mode\n if (exports === 'mixed') {\n exports = 'auto';\n }\n break;\n default:\n throw new Error(`Unsupported library format: ${format}`);\n }\n const nodeEnv = options.nodeEnv ?? process.env.NODE_ENV;\n const minify = options.minify ?? (nodeEnv === 'production');\n const camelCaseToDashCase = (s) => s.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n const filenamePrefix = options.filenamePrefix ?? camelCaseToDashCase(libraryName);\n const filenameBase = `${filenamePrefix}${minify ? '.min' : ''}`;\n const filename = `${filenameBase}${filenameExt}`;\n const outputDir = options.outputDir ?? 'dist';\n const sourcemap = options.sourcemap ?? true;\n // save some configuration to the options object\n options.format = format;\n options.name = libraryName;\n options.minify = minify;\n options.filenamePrefix = filenamePrefix;\n options.filenameBase = filenameBase;\n options.filenameExt = filenameExt;\n options.filename = filename;\n options.exports = exports;\n options.sourcemap = sourcemap;\n options.outputDir = outputDir;\n return {\n name: libraryName,\n file: `${outputDir}/${filename}`,\n format,\n exports,\n footer,\n sourcemap,\n compact: minify,\n };\n}\n\nexport default getRollupOutput;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport { fileURLToPath } from 'node:url';\nimport alias from '@rollup/plugin-alias';\n\n/**\n * Configures the `@rollup/plugin-alias` plugin.\n *\n * @param {string} format\n * The format of the library.\n * @param {string} importMetaUrl\n * The URL of the `import.meta` of the caller module.\n * @param {object} options\n * The additional options for building the library.\n * @param {Array<Object>} plugins\n * The Rollup plugins array.\n * @returns {Array<Object>}\n * The modified Rollup plugins array.\n * @author Haixing Hu\n * @see https://www.npmjs.com/package/@rollup/plugin-alias\n */\nfunction configAliasPlugin(format, importMetaUrl, options, plugins) {\n if (options.useAliasPlugin ?? true) {\n // The @rollup/plugin-alias enables us to use absolute import paths for\n // \"src\" (or any other path you want to configure).\n const pluginOptions = options.aliasPluginOptions ?? {\n entries: {\n 'src': fileURLToPath(new URL('src', importMetaUrl)),\n },\n };\n if (options.debug === true) {\n console.debug('[DEBUG] The @rollup/plugin-alias plugin options are:');\n console.dir(pluginOptions, { depth: null });\n }\n plugins.push(alias(pluginOptions));\n }\n return plugins;\n}\n\nexport default configAliasPlugin;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport nodeResolve from '@rollup/plugin-node-resolve';\n\n/**\n * Configures the `@rollup/plugin-node-resolve` plugin.\n *\n * @param {string} format\n * The format of the library.\n * @param {string} importMetaUrl\n * The URL of the `import.meta` of the caller module.\n * @param {object} options\n * The additional options for building the library.\n * @param {Array<Object>} plugins\n * The Rollup plugins array.\n * @returns {Array<Object>}\n * The modified Rollup plugins array.\n * @author Haixing Hu\n * @see https://www.npmjs.com/package/@rollup/plugin-node-resolve\n */\nfunction configNodeResolvePlugin(format, importMetaUrl, options, plugins) {\n if (options.useNodeResolvePlugin ?? true) {\n // The @rollup/plugin-node-resolve allows Rollup to resolve external\n // modules from node_modules:\n const pluginOptions = options.nodeResolvePluginOptions ?? {};\n if (options.debug === true) {\n console.debug('[DEBUG] The @rollup/plugin-node-resolve plugin options are:');\n console.dir(pluginOptions, { depth: null });\n }\n plugins.push(nodeResolve(pluginOptions));\n }\n return plugins;\n}\n\nexport default configNodeResolvePlugin;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport commonjs from '@rollup/plugin-commonjs';\n\n/**\n * Configures the `@rollup/plugin-commonjs` plugin.\n *\n * @param {string} format\n * The format of the library.\n * @param {string} importMetaUrl\n * The URL of the `import.meta` of the caller module.\n * @param {object} options\n * The additional options for building the library.\n * @param {Array<Object>} plugins\n * The Rollup plugins array.\n * @returns {Array<Object>}\n * The modified Rollup plugins array.\n * @author Haixing Hu\n * @see https://www.npmjs.com/package/@rollup/plugin-commonjs\n */\nfunction configCommonJsPlugin(format, importMetaUrl, options, plugins) {\n if (options.useCommonjsPlugin ?? true) {\n // The @rollup/plugin-commonjs plugin converts 3rd-party CommonJS modules\n // into ES6 code, so that they can be included in our Rollup bundle.\n // When using @rollup/plugin-babel with @rollup/plugin-commonjs in the\n // same Rollup configuration, it's important to note that\n // @rollup/plugin-commonjs must be placed before this plugin in the\n // plugins array for the two to work together properly.\n const pluginOptions = options.commonjsPluginOptions ?? {\n include: ['node_modules/**'],\n };\n if (options.debug === true) {\n console.debug('[DEBUG] The @rollup/plugin-commonjs plugin options are:');\n console.dir(pluginOptions, { depth: null });\n }\n plugins.push(commonjs(pluginOptions));\n }\n return plugins;\n}\n\nexport default configCommonJsPlugin;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport babel from '@rollup/plugin-babel';\n\n/**\n * Configures the `@rollup/plugin-babel` plugin.\n *\n * @param {string} format\n * The format of the library.\n * @param {string} importMetaUrl\n * The URL of the `import.meta` of the caller module.\n * @param {object} options\n * The additional options for building the library.\n * @param {Array} plugins\n * The array of Rollup plugins.\n * @returns {Array<Object>}\n * The modified Rollup plugins array.\n * @author Haixing Hu\n * @see https://www.npmjs.com/package/@rollup/plugin-babel\n */\nfunction configBabelPlugin(format, importMetaUrl, options, plugins) {\n if (options.useBabelPlugin ?? true) {\n const pluginOptions = options.babelPluginOptions ?? {\n babelHelpers: 'runtime',\n exclude: ['node_modules/**'],\n presets: [\n // The @babel/preset-env preset enables Babel to transpile ES6+ code\n // and the rollup requires that Babel keeps ES6 module syntax intact.\n ['@babel/preset-env', { modules: false }],\n ],\n plugins: [\n '@babel/plugin-transform-runtime',\n ],\n };\n if (options.debug === true) {\n console.debug('[DEBUG] The @rollup/plugin-babel plugin options are:');\n console.dir(pluginOptions, { depth: null });\n }\n plugins.push(babel(pluginOptions));\n }\n return plugins;\n}\n\nexport default configBabelPlugin;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport terser from '@rollup/plugin-terser';\n\n/**\n * Configures the `@rollup/plugin-terser` plugin.\n *\n * @param {string} format\n * The format of the library.\n * @param {string} importMetaUrl\n * The URL of the `import.meta` of the caller module.\n * @param {object} options\n * The additional options for building the library.\n * @param {Array} plugins\n * The array of Rollup plugins.\n * @returns {Array<Object>}\n * The modified Rollup plugins array.\n * @author Haixing Hu\n * @see https://www.npmjs.com/package/@rollup/plugin-terser\n */\nfunction configTerserPlugin(format, importMetaUrl, options, plugins) {\n const nodeEnv = options.nodeEnv ?? process.env.NODE_ENV;\n const minify = options.minify ?? (nodeEnv === 'production');\n if (minify) {\n // The @rollup/plugin-terser uses terser under the hood to minify the code.\n const pluginOptions = options.terserPluginOptions ?? {\n output: {\n comments: false, // default to remove all comments\n },\n keep_classnames: true, // keep the class names\n keep_fnames: true, // keep the function names\n };\n if (options.debug === true) {\n console.debug('[DEBUG] The @rollup/plugin-terser plugin options are:');\n console.dir(pluginOptions, { depth: null });\n }\n plugins.push(terser(pluginOptions));\n }\n return plugins;\n}\n\nexport default configTerserPlugin;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport analyzer from 'rollup-plugin-analyzer';\n\n/**\n * Configures the `rollup-plugin-analyzer` plugin.\n *\n * @param {string} format\n * The format of the library.\n * @param {string} importMetaUrl\n * The URL of the `import.meta` of the caller module.\n * @param {object} options\n * The additional options for building the library.\n * @param {Array} plugins\n * The array of Rollup plugins.\n * @returns {Array<Object>}\n * The modified Rollup plugins array.\n * @author Haixing Hu\n * @see https://www.npmjs.com/package/rollup-plugin-analyzer\n */\nfunction configAnalyzerPlugin(format, importMetaUrl, options, plugins) {\n if (options.useAnalyzerPlugin ?? true) {\n // The rollup-plugin-analyzer will print out some useful info about our\n // generated bundle upon successful builds.\n const pluginOptions = options.analyzerPluginOptions ?? {\n hideDeps: true,\n limit: 0,\n summaryOnly: true,\n };\n if (options.debug === true) {\n console.debug('[DEBUG] The rollup-plugin-analyzer plugin options are:');\n console.dir(pluginOptions, { depth: null });\n }\n plugins.push(analyzer(pluginOptions));\n }\n return plugins;\n}\n\nexport default configAnalyzerPlugin;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport { visualizer } from 'rollup-plugin-visualizer';\n\n/**\n * Configures the `rollup-plugin-visualizer` plugin.\n *\n * The `rollup-plugin-visualizer` will visualize and analyze your Rollup\n * bundle to see which modules are taking up space.\n *\n * @param {string} format\n * The format of the library.\n * @param {string} importMetaUrl\n * The URL of the `import.meta` of the caller module.\n * @param {object} options\n * The additional options for building the library.\n * @param {Array} plugins\n * The array of Rollup plugins.\n * @returns {Array<Object>}\n * The modified Rollup plugins array.\n * @author Haixing Hu\n * @see https://www.npmjs.com/package/rollup-plugin-visualizer\n */\nfunction configVisualizerPlugin(format, importMetaUrl, options, plugins) {\n if (options.useVisualizerPlugin ?? true) {\n // The rollup-plugin-visualizer will visualize and analyze your Rollup\n // bundle to see which modules are taking up space.\n const pluginOptions = options.visualizerPluginOptions ?? {\n filename: `./doc/${options.filenameBase}.visualization.html`,\n gzipSize: true,\n brotliSize: true,\n };\n if (options.debug === true) {\n console.debug('[DEBUG] The rollup-plugin-visualizer plugin options are:');\n console.dir(pluginOptions, { depth: null });\n }\n plugins.push(visualizer(pluginOptions));\n }\n return plugins;\n}\n\nexport default configVisualizerPlugin;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport json from '@rollup/plugin-json';\nimport configAliasPlugin from './plugins/config-alias-plugin.mjs';\nimport configNodeResolvePlugin from './plugins/config-node-resolve-plugin.mjs';\nimport configCommonJsPlugin from './plugins/config-common-js-plugin.mjs';\nimport configBabelPlugin from './plugins/config-babel-plugin.mjs';\nimport configTerserPlugin from './plugins/config-terser-plugin.mjs';\nimport configAnalyzerPlugin from './plugins/config-analyzer-plugin.mjs';\nimport configVisualizerPlugin from './plugins/config-visualizer-plugin.mjs';\n\n/**\n * Gets Rollup `plugins` configuration.\n *\n * @param {string} format\n * The format of the library.\n * @param {string} importMetaUrl\n * The URL of the `import.meta` of the caller module.\n * @param {object} options\n * The additional options for building the library.\n * @returns {Array<Object>}\n * The Rollup plugins array.\n * @author Haixing Hu\n */\nfunction getRollupPlugins(format, importMetaUrl, options) {\n const plugins = [];\n plugins.push(json());\n configAliasPlugin(format, importMetaUrl, options, plugins);\n configNodeResolvePlugin(format, importMetaUrl, options, plugins);\n configCommonJsPlugin(format, importMetaUrl, options, plugins);\n configBabelPlugin(format, importMetaUrl, options, plugins);\n configTerserPlugin(format, importMetaUrl, options, plugins);\n configAnalyzerPlugin(format, importMetaUrl, options, plugins);\n configVisualizerPlugin(format, importMetaUrl, options, plugins);\n // The user can specify additional plugins.\n if (options.plugins) {\n plugins.push(...options.plugins);\n }\n return plugins;\n}\n\nexport default getRollupPlugins;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2024.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\n\nfunction getRollupOnWarn() {\n return function onWarn(warning, warn) {\n // skip certain warnings\n if (warning.code === 'INVALID_ANNOTATION'\n && warning.message.includes('#__PURE__')\n && warning.message.includes('terser')) {\n return;\n }\n if (warning.code === 'CIRCULAR_DEPENDENCY'\n && warning.message.includes('node_modules')) {\n return;\n }\n // Use default for everything else\n warn(warning);\n };\n}\n\nexport default getRollupOnWarn;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport getRollupExternal from './get-rollup-external.mjs';\nimport getRollupOutput from './get-rollup-output.mjs';\nimport getRollupPlugins from './get-rollup-plugins.mjs';\nimport getRollupOnWarn from './get-rollup-on-warn.mjs';\n\n/**\n * Builds the Rollup configuration for a library.\n *\n * The function could be provided with an additional options for building the\n * library. It can have the following fields:\n *\n * - `debug: boolean`: whether to print the debug information. If this field is\n * not specified, the default value is `false`.\n * - `formats: [string]`: the array of formats of the library. It can be an\n * array of the following values:\n * - `'cjs'`: the CommonJS format.\n * - `'umd'`: the UMD format.\n * - `'esm'`: the ES module format.\n *\n * If this field is not specified, the default value is `['cjs', 'esm']`.\n * - `exports: string`: the export mode to use. It can be one of the following\n * values:\n * - `'auto'`: automatically guesses your intentions based on what the input\n * module exports.\n * - `'default'`: if you are only exporting one thing using `export default ...`;\n * note that this can cause issues when generating CommonJS output that is\n * meant to be interchangeable with ESM output.\n * - `'named'`: if you are using named exports.\n * - `'none'`: if you are not exporting anything (e.g. you are building an\n * app, not a library)\n * - `'mixed'`: if you are using named exports mixed with a default export.\n * Note that this is not a standard exports mode officially supported by\n * the `rollup`, instead, it is an additional mode add by this library.\n *\n * See [output.exports](https://rollupjs.org/configuration-options/#output-exports)\n * for more details. If this field is not specified, the default value is\n * `'auto'`.\n * - `nodeEnv: string`: the value of the `NODE_ENV` environment variable. If\n * this field is not specified, the default value is `process.env.NODE_ENV`.\n * - `minify: boolean`: whether to minify the code. If this field is not\n * specified, and the `nodeEnv` is `production`, the default value is `true`;\n * otherwise the default value is `false`.\n * - `sourcemap: boolean`: whether to generate the source map. If this field is\n * not specified, the default value is `true`.\n * - `input: string`: the input file of the library. If this field is not\n * specified, the default value is `src/index.js`.\n * - `outputDir: string`: the output directory of the library. If this field is\n * not specified, the default value is `dist`.\n * - `filenamePrefix: string`: the prefix of the output filename. If this field\n * is not specified, the default value is the dash case of the library name.\n * For example, if the library name is `MyLibrary`, the default value of this\n * field is `my-library`.\n * - `externals: [string]`: the array of additional external packages, each can\n * be specified with either a string or a regular expression. If this field is\n * not specified, the default value is an empty array.\n * - `useAliasPlugin: boolean`: whether to use the `@rollup/plugin-alias` plugin.\n * If this field is not specified, the default value is `true`.\n * - `aliasPluginOptions: object`: the options for the `@rollup/plugin-alias`\n * plugin. If this field is not specified, the default value is:\n * ```js\n * {\n * entries: {\n * 'src': fileURLToPath(new URL('src', importMetaUrl)),\n * },\n * }\n * ```\n * - `useNodeResolvePlugin: boolean`: whether to use the `@rollup/plugin-node-resolve`\n * plugin. If this field is not specified, the default value is `true`.\n * - `nodeResolvePluginOptions: object`: the options for the `@rollup/plugin-node-resolve`\n * plugin. If this field is not specified, the default value is: `{}`.\n * - `useCommonjsPlugin: boolean`: whether to use the `@rollup/plugin-commonjs`\n * plugin. If this field is not specified, the default value is `true`.\n * - `commonjsPluginOptions: object`: the options for the `@rollup/plugin-commonjs`\n * plugin. If this field is not specified, the default value is:\n * ```js\n * {\n * include: ['node_modules/**'],\n * }\n * ```\n * - `useBabelPlugin: boolean`: whether to use the `@rollup/plugin-babel` plugin.\n * If this field is not specified, the default value is `true`.\n * - `babelPluginOptions: object`: the options for the `@rollup/plugin-babel`\n * plugin. If this field is not specified, the default value is:\n * ```js\n * {\n * babelHelpers: 'runtime',\n * exclude: ['node_modules/**'],\n * presets: [\n * '@babel/preset-env',\n * ],\n * plugins: [\n * '@babel/plugin-transform-runtime',\n * ],\n * }\n * ```\n * Note that when using the `@rollup/plugin-babel` plugin, you can also specify\n * the configuration of Babel in the standard Babel configuration files,\n * such as `babel.config.js`, `.babelrc`, etc.\n * - `terserOptions: object`: the options for the `@rollup/plugin-terser` plugin.\n * If this field is not specified, the default value is: `{}`. Whether to use\n * the `@rollup/plugin-terser` plugin depends on the `minify` field of the\n * options or the `NODE_ENV` environment variable.\n * - `useAnalyzerPlugin: boolean`: whether to use the `rollup-plugin-analyzer`\n * plugin. If this field is not specified, the default value is `true`.\n * - `analyzerOptions: object`: the options for the `rollup-plugin-analyzer`\n * plugin. If this field is not specified, the default value is:\n * ```js\n * {\n * hideDeps: true,\n * limit: 0,\n * summaryOnly: true,\n * }\n * ```\n * - `plugins: [object]`: the array of configuration of additional Rollup\n * plugins. If this field is not specified, the default value is an empty\n * array.\n *\n * @param {string} libraryName\n * The name of the library, which will be used as the name of the global\n * variable in the UMD format. It should in the camel case.\n * @param {string} importMetaUrl\n * The URL of the `import.meta` of the caller module. It **MUST** be passed\n * with the `import.meta.url` of the caller module.\n * @param {object} options\n * The additional options for building the library, as described above.\n * @returns {Array<object>}\n * the array of Rollup configurations for the library.\n */\nfunction rollupBuilder(libraryName, importMetaUrl, options = {}) {\n const formats = options.formats ?? ['cjs', 'esm'];\n const result = [];\n const input = options.input ?? 'src/index.js';\n for (const format of formats) {\n const clonedOptions = { ...options };\n const output = getRollupOutput(format, libraryName, clonedOptions);\n const external = getRollupExternal(importMetaUrl, clonedOptions);\n const plugins = getRollupPlugins(format, importMetaUrl, clonedOptions);\n const onwarn = getRollupOnWarn();\n const config = { input, output, external, plugins, onwarn };\n result.push(config);\n if (options.debug === true) {\n console.debug(`[DEBUG] The options for the format ${format} is:`);\n console.dir(clonedOptions, { depth: null });\n }\n }\n if (options.debug === true) {\n console.debug('[DEBUG] The generated rollup configurations are:');\n console.dir(result, { depth: null });\n }\n return result;\n}\n\nexport default rollupBuilder;\n","////////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2022 - 2023.\n// Haixing Hu, Qubit Co. Ltd.\n//\n// All rights reserved.\n//\n////////////////////////////////////////////////////////////////////////////////\nimport rollupBuilder from './rollup-builder.mjs';\n\nexport default rollupBuilder;\n"],"names":["getRollupExternal","importMetaUrl","options","_options$externals","Error","require","createRequire","pkg","peers","_toConsumableArray","Object","keys","peerDependencies","Array","isArray","length","peerPattern","RegExp","concat","join","additions","externals","id","test","_iterator","_createForOfIteratorHelper","_step","s","n","done","pattern","value","String","err","e","f","getRollupOutput","format","libraryName","_options$exports","_options$nodeEnv","_options$minify","_options$filenamePref","_options$outputDir","_options$sourcemap","filenameExt","footer","exports","nodeEnv","process","env","NODE_ENV","minify","camelCaseToDashCase","replace","toLowerCase","filenamePrefix","filenameBase","filename","outputDir","sourcemap","name","file","compact","configAliasPlugin","plugins","_options$useAliasPlug","useAliasPlugin","_options$aliasPluginO","pluginOptions","aliasPluginOptions","entries","fileURLToPath","URL","debug","console","dir","depth","push","alias","configNodeResolvePlugin","_options$useNodeResol","useNodeResolvePlugin","_options$nodeResolveP","nodeResolvePluginOptions","nodeResolve","configCommonJsPlugin","_options$useCommonjsP","useCommonjsPlugin","_options$commonjsPlug","commonjsPluginOptions","include","commonjs","configBabelPlugin","_options$useBabelPlug","useBabelPlugin","_options$babelPluginO","babelPluginOptions","babelHelpers","exclude","presets","modules","babel","configTerserPlugin","_options$terserPlugin","terserPluginOptions","output","comments","keep_classnames","keep_fnames","terser","configAnalyzerPlugin","_options$useAnalyzerP","useAnalyzerPlugin","_options$analyzerPlug","analyzerPluginOptions","hideDeps","limit","summaryOnly","analyzer","configVisualizerPlugin","_options$useVisualize","useVisualizerPlugin","_options$visualizerPl","visualizerPluginOptions","gzipSize","brotliSize","visualizer","getRollupPlugins","json","apply","getRollupOnWarn","onWarn","warning","warn","code","message","includes","rollupBuilder","_options$formats","_options$input","arguments","undefined","formats","result","input","clonedOptions","_objectSpread","external","onwarn","config"],"mappings":";;;;;;;;;;;;;;;;;;;AAUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,iBAAiBA,CAACC,aAAa,EAAEC,OAAO,EAAE;AAAA,EAAA,IAAAC,kBAAA;EACjD,IAAI,CAACF,aAAa,EAAE;AAClB,IAAA,MAAM,IAAIG,KAAK,CAAC,2BAA2B,CAAC;AAC9C;EACA,IAAI,CAACF,OAAO,EAAE;AACZ,IAAA,MAAM,IAAIE,KAAK,CAAC,qBAAqB,CAAC;AACxC;AACA;AACA,EAAA,IAAMC,OAAO,GAAGC,yBAAa,CAACL,aAAa,CAAC;AAC5C,EAAA,IAAMM,GAAG,GAAGF,OAAO,CAAC,gBAAgB,CAAC;AACrC,EAAA,IAAMG,KAAK,GAAAC,kBAAA,CAAOC,MAAM,CAACC,IAAI,CAACJ,GAAG,CAACK,gBAAgB,IAAI,EAAE,CAAC,CAAC;AAC1D,EAAA,IAAI,CAACC,KAAK,CAACC,OAAO,CAACN,KAAK,CAAC,EAAE;AACzB,IAAA,MAAM,IAAIJ,KAAK,CAAC,qCAAqC,CAAC;AACxD;AACA,EAAA,IAAII,KAAK,CAACO,MAAM,KAAK,CAAC,EAAE;AACtB,IAAA,OAAO,EAAE;AACX;AACA,EAAA,IAAMC,WAAW,GAAIR,KAAK,GAAG,IAAIS,MAAM,MAAAC,MAAA,CAAMV,KAAK,CAACW,IAAI,CAAC,GAAG,CAAC,EAAQ,QAAA,CAAA,CAAC,GAAG,IAAK;AAC7E;AACA,EAAA,IAAMC,SAAS,GAAA,CAAAjB,kBAAA,GAAGD,OAAO,CAACmB,SAAS,MAAA,IAAA,IAAAlB,kBAAA,KAAA,MAAA,GAAAA,kBAAA,GAAI,EAAE;AACzC;EACAD,OAAO,CAACM,KAAK,GAAGA,KAAK;EACrBN,OAAO,CAACc,WAAW,GAAGA,WAAW;EACjC,OAAO,UAACM,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kE,eAAeA,GAAG;AACzB,EAAA,OAAO,SAASC,MAAMA,CAACC,OAAO,EAAEC,IAAI,EAAE;AACpC;IACA,IAAID,OAAO,CAACE,IAAI,KAAK,oBAAoB,IAClCF,OAAO,CAACG,OAAO,CAACC,QAAQ,CAAC,WAAW,CAAC,IACrCJ,OAAO,CAACG,OAAO,CAACC,QAAQ,CAAC,QAAQ,CAAC,EAAE;AACzC,MAAA;AACF;AACA,IAAA,IAAIJ,OAAO,CAACE,IAAI,KAAK,qBAAqB,IACnCF,OAAO,CAACG,OAAO,CAACC,QAAQ,CAAC,cAAc,CAAC,EAAE;AAC/C,MAAA;AACF;AACA;IACAH,IAAI,CAACD,OAAO,CAAC;GACd;AACH;;;;;;;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASK,aAAaA,CAACpG,WAAW,EAAErC,aAAa,EAAgB;EAAA,IAAA0I,gBAAA,EAAAC,cAAA;AAAA,EAAA,IAAd1I,OAAO,GAAA2I,SAAA,CAAA9H,MAAA,GAAA,CAAA,IAAA8H,SAAA,CAAA,CAAA,CAAA,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