@ms-cloudpack/bundler-rollup 0.4.25 → 0.5.1
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getRollupOptions.d.ts","sourceRoot":"","sources":["../src/getRollupOptions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC/E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAE5E,OAAO,KAAK,EAAgB,aAAa,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAUpF;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE;IACN,OAAO,EAAE,IAAI,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC;IACxC,OAAO,EAAE,aAAa,CAAC;CACxB,GAAG,IAAI,CAAC,mBAAmB,EAAE,YAAY,CAAC,GAC1C;IACD,YAAY,EAAE,aAAa,CAAC;IAC5B,aAAa,EAAE,aAAa,CAAC;IAC7B,sFAAsF;IACtF,QAAQ,EAAE,SAAS,EAAE,CAAC;CACvB,
|
|
1
|
+
{"version":3,"file":"getRollupOptions.d.ts","sourceRoot":"","sources":["../src/getRollupOptions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC/E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAE5E,OAAO,KAAK,EAAgB,aAAa,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAUpF;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE;IACN,OAAO,EAAE,IAAI,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC;IACxC,OAAO,EAAE,aAAa,CAAC;CACxB,GAAG,IAAI,CAAC,mBAAmB,EAAE,YAAY,CAAC,GAC1C;IACD,YAAY,EAAE,aAAa,CAAC;IAC5B,aAAa,EAAE,aAAa,CAAC;IAC7B,sFAAsF;IACtF,QAAQ,EAAE,SAAS,EAAE,CAAC;CACvB,CAwEA"}
|
package/lib/getRollupOptions.js
CHANGED
|
@@ -11,12 +11,13 @@ const ignoredWarnings = ['Circular dependency:'];
|
|
|
11
11
|
*/
|
|
12
12
|
export function getRollupOptions(params) {
|
|
13
13
|
const { options, context, newEntries } = params;
|
|
14
|
-
const { inputPath, minify, external = [], inlined = [], bundlerOptions = {}, dynamicImports, sourcemap, bundlerCapabilities, dedupeAliases, } = options;
|
|
14
|
+
const { packageName, inputPath, minify, external = [], inlined = [], bundlerOptions = {}, dynamicImports, sourcemap, bundlerCapabilities, dedupeAliases, } = options;
|
|
15
15
|
const warnings = [];
|
|
16
16
|
return {
|
|
17
17
|
warnings,
|
|
18
18
|
inputOptions: {
|
|
19
19
|
external: (id, parent) => shouldExternalizePackage({
|
|
20
|
+
packageName,
|
|
20
21
|
inputPath,
|
|
21
22
|
id,
|
|
22
23
|
parent,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getRollupOptions.js","sourceRoot":"","sources":["../src/getRollupOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAG3E,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,wFAAwF;AACxF,mDAAmD;AACnD,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,WAAW,EAAE,cAAc,CAAC,CAAC,CAAC;AAEnE,yCAAyC;AACzC,MAAM,eAAe,GAAG,CAAC,sBAAsB,CAAC,CAAC;AAEjD;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAC9B,MAG2C;IAO3C,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,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;gBAClB,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC;oBAC1E,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;gBACzB,CAAC;YACH,CAAC;SACF;QACD,aAAa,EAAE;YACb,SAAS;YACT,GAAI,cAAc,CAAC,aAA+B;YAClD,8BAA8B;YAC9B,GAAG,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS;YACjF,MAAM,EAAE,IAAI;YACZ,cAAc,EAAE,WAAW;YAC3B,cAAc,EAAE,WAAW;YAC3B,cAAc,EAAE,yBAAyB;YACzC,6EAA6E;YAC7E,wEAAwE;YACxE,mFAAmF;YACnF,sBAAsB,EAAE,CAAC,kBAAkB,EAAE,aAAa,EAAE,EAAE;YAC5D,8DAA8D;YAC9D,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,kBAAkB,CAAC,CAAC;SACxG;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { shouldExternalizePackage } from '@ms-cloudpack/bundler-utilities';\nimport type { BundleContext, BundleOptions } from '@ms-cloudpack/common-types';\nimport type { WriteESMStubsResult } from '@ms-cloudpack/esm-stub-utilities';\nimport path from 'path';\nimport type { InputOptions, OutputOptions, RollupLog, RollupOptions } from 'rollup';\nimport { getRollupPlugins } from './getRollupPlugins.js';\n\n// These are the polyfills that we support from the 'rollup-plugin-polyfill-node' plugin\n// that are not included in the node builtins list.\nconst polyfills = new Set(['global', '_inherits', '_buffer_list']);\n\n// Spammy, usually non-actionable warning\nconst ignoredWarnings = ['Circular dependency:'];\n\n/**\n * Converts BundlerOptions to Rollup-specific options.\n */\nexport function getRollupOptions(\n params: {\n options: Omit<BundleOptions, 'entries'>;\n context: BundleContext;\n } & Pick<WriteESMStubsResult, 'newEntries'>,\n): {\n inputOptions: RollupOptions;\n outputOptions: OutputOptions;\n /** Warnings will be pushed to this array (rollup handles warnings with a callback) */\n warnings: RollupLog[];\n} {\n const { options, context, newEntries } = params;\n const {\n inputPath,\n minify,\n external = [],\n inlined = [],\n bundlerOptions = {},\n dynamicImports,\n sourcemap,\n bundlerCapabilities,\n dedupeAliases,\n } = options;\n const warnings: RollupLog[] = [];\n\n return {\n warnings,\n inputOptions: {\n external: (id, parent) =>\n shouldExternalizePackage({\n inputPath,\n id,\n parent,\n inlined,\n external,\n polyfills,\n shouldInlineNodeBuiltins: true,\n targetEnvironment: options.targetEnvironment,\n mode: context.config.mode,\n }),\n ...(bundlerOptions.inputOptions as InputOptions),\n // Don't allow overriding the options below\n\n // Rollup requires entry keys without a leading ./\n input: Object.fromEntries(Object.entries(newEntries).map(([key, value]) => [key.replace(/^\\.\\//, ''), value])),\n // These are not possible to override properly via JSON config\n plugins: getRollupPlugins({\n isProduction: minify,\n packagePath: inputPath,\n requiresTranspile: context.requiresTranspile,\n dynamicImports,\n sourcemap,\n resolveWebExtensions: !!bundlerCapabilities?.['resolve-web-extensions'],\n config: context.config,\n relay: bundlerCapabilities?.relay,\n dedupeAliases,\n }),\n onwarn: (warning) => {\n if (!ignoredWarnings.some((ignored) => warning.message.includes(ignored))) {\n warnings.push(warning);\n }\n },\n },\n outputOptions: {\n sourcemap,\n ...(bundlerOptions.outputOptions as OutputOptions),\n // No overriding these options\n dir: options.outputPath ? path.resolve(inputPath, options.outputPath) : inputPath,\n format: 'es',\n entryFileNames: '[name].js',\n chunkFileNames: '[name].js',\n assetFileNames: 'assets/[name]-[extname]',\n // This is a fix so that the sourcemaps never include the hash in their path,\n // as that invalidates the sourcemap on change and removes break points.\n // ../../../../relative/path/to/src/path/to/file.ts -> rollup://src/path/to/file.ts\n sourcemapPathTransform: (relativeSourcePath, sourcemapPath) =>\n // No need to normalize the path as rollup will do that for us\n 'rollup://' + path.relative(inputPath, path.resolve(path.dirname(sourcemapPath), relativeSourcePath)),\n },\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"getRollupOptions.js","sourceRoot":"","sources":["../src/getRollupOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAG3E,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,wFAAwF;AACxF,mDAAmD;AACnD,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,WAAW,EAAE,cAAc,CAAC,CAAC,CAAC;AAEnE,yCAAyC;AACzC,MAAM,eAAe,GAAG,CAAC,sBAAsB,CAAC,CAAC;AAEjD;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAC9B,MAG2C;IAO3C,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;IAChD,MAAM,EACJ,WAAW,EACX,SAAS,EACT,MAAM,EACN,QAAQ,GAAG,EAAE,EACb,OAAO,GAAG,EAAE,EACZ,cAAc,GAAG,EAAE,EACnB,cAAc,EACd,SAAS,EACT,mBAAmB,EACnB,aAAa,GACd,GAAG,OAAO,CAAC;IACZ,MAAM,QAAQ,GAAgB,EAAE,CAAC;IAEjC,OAAO;QACL,QAAQ;QACR,YAAY,EAAE;YACZ,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,CACvB,wBAAwB,CAAC;gBACvB,WAAW;gBACX,SAAS;gBACT,EAAE;gBACF,MAAM;gBACN,OAAO;gBACP,QAAQ;gBACR,SAAS;gBACT,wBAAwB,EAAE,IAAI;gBAC9B,iBAAiB,EAAE,OAAO,CAAC,iBAAiB;gBAC5C,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,IAAI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A6E;YAC7E,wEAAwE;YACxE,mFAAmF;YACnF,sBAAsB,EAAE,CAAC,kBAAkB,EAAE,aAAa,EAAE,EAAE;YAC5D,8DAA8D;YAC9D,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,kBAAkB,CAAC,CAAC;SACxG;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { shouldExternalizePackage } from '@ms-cloudpack/bundler-utilities';\nimport type { BundleContext, BundleOptions } from '@ms-cloudpack/common-types';\nimport type { WriteESMStubsResult } from '@ms-cloudpack/esm-stub-utilities';\nimport path from 'path';\nimport type { InputOptions, OutputOptions, RollupLog, RollupOptions } from 'rollup';\nimport { getRollupPlugins } from './getRollupPlugins.js';\n\n// These are the polyfills that we support from the 'rollup-plugin-polyfill-node' plugin\n// that are not included in the node builtins list.\nconst polyfills = new Set(['global', '_inherits', '_buffer_list']);\n\n// Spammy, usually non-actionable warning\nconst ignoredWarnings = ['Circular dependency:'];\n\n/**\n * Converts BundlerOptions to Rollup-specific options.\n */\nexport function getRollupOptions(\n params: {\n options: Omit<BundleOptions, 'entries'>;\n context: BundleContext;\n } & Pick<WriteESMStubsResult, 'newEntries'>,\n): {\n inputOptions: RollupOptions;\n outputOptions: OutputOptions;\n /** Warnings will be pushed to this array (rollup handles warnings with a callback) */\n warnings: RollupLog[];\n} {\n const { options, context, newEntries } = params;\n const {\n packageName,\n inputPath,\n minify,\n external = [],\n inlined = [],\n bundlerOptions = {},\n dynamicImports,\n sourcemap,\n bundlerCapabilities,\n dedupeAliases,\n } = options;\n const warnings: RollupLog[] = [];\n\n return {\n warnings,\n inputOptions: {\n external: (id, parent) =>\n shouldExternalizePackage({\n packageName,\n inputPath,\n id,\n parent,\n inlined,\n external,\n polyfills,\n shouldInlineNodeBuiltins: true,\n targetEnvironment: options.targetEnvironment,\n mode: context.config.mode,\n }),\n ...(bundlerOptions.inputOptions as InputOptions),\n // Don't allow overriding the options below\n\n // Rollup requires entry keys without a leading ./\n input: Object.fromEntries(Object.entries(newEntries).map(([key, value]) => [key.replace(/^\\.\\//, ''), value])),\n // These are not possible to override properly via JSON config\n plugins: getRollupPlugins({\n isProduction: minify,\n packagePath: inputPath,\n requiresTranspile: context.requiresTranspile,\n dynamicImports,\n sourcemap,\n resolveWebExtensions: !!bundlerCapabilities?.['resolve-web-extensions'],\n config: context.config,\n relay: bundlerCapabilities?.relay,\n dedupeAliases,\n }),\n onwarn: (warning) => {\n if (!ignoredWarnings.some((ignored) => warning.message.includes(ignored))) {\n warnings.push(warning);\n }\n },\n },\n outputOptions: {\n sourcemap,\n ...(bundlerOptions.outputOptions as OutputOptions),\n // No overriding these options\n dir: options.outputPath ? path.resolve(inputPath, options.outputPath) : inputPath,\n format: 'es',\n entryFileNames: '[name].js',\n chunkFileNames: '[name].js',\n assetFileNames: 'assets/[name]-[extname]',\n // This is a fix so that the sourcemaps never include the hash in their path,\n // as that invalidates the sourcemap on change and removes break points.\n // ../../../../relative/path/to/src/path/to/file.ts -> rollup://src/path/to/file.ts\n sourcemapPathTransform: (relativeSourcePath, sourcemapPath) =>\n // No need to normalize the path as rollup will do that for us\n 'rollup://' + path.relative(inputPath, path.resolve(path.dirname(sourcemapPath), relativeSourcePath)),\n },\n };\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ms-cloudpack/bundler-rollup",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "Cloudpack's wrapper for the Rollup bundler",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -14,13 +14,13 @@
|
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@ms-cloudpack/bundler-capabilities": "^0.4.
|
|
18
|
-
"@ms-cloudpack/bundler-utilities": "^0.
|
|
19
|
-
"@ms-cloudpack/common-types": "^0.
|
|
20
|
-
"@ms-cloudpack/esm-stub-utilities": "^0.15.
|
|
21
|
-
"@ms-cloudpack/package-utilities": "^13.1
|
|
17
|
+
"@ms-cloudpack/bundler-capabilities": "^0.4.7",
|
|
18
|
+
"@ms-cloudpack/bundler-utilities": "^0.7.1",
|
|
19
|
+
"@ms-cloudpack/common-types": "^0.32.1",
|
|
20
|
+
"@ms-cloudpack/esm-stub-utilities": "^0.15.28",
|
|
21
|
+
"@ms-cloudpack/package-utilities": "^13.2.1",
|
|
22
22
|
"@ms-cloudpack/path-string-parsing": "^1.2.7",
|
|
23
|
-
"@ms-cloudpack/path-utilities": "^3.1.
|
|
23
|
+
"@ms-cloudpack/path-utilities": "^3.1.33",
|
|
24
24
|
"@rollup/plugin-alias": "^5.0.1",
|
|
25
25
|
"@rollup/plugin-commonjs": "^28.0.4",
|
|
26
26
|
"@rollup/plugin-dynamic-import-vars": "^2.0.0",
|