@ms-cloudpack/bundler-utilities 0.7.4 → 0.8.0

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.
@@ -6,5 +6,4 @@
6
6
  * ES2023 features are obviously relevant for a bundler), so stick with ES2022 for now.
7
7
  */
8
8
  export declare const defaultTargetSyntax = "es2022";
9
- export declare const base64AssetExtensions: string[];
10
9
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,WAAW,CAAC;AAE5C,eAAO,MAAM,qBAAqB,UAmBjC,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,WAAW,CAAC"}
package/lib/constants.js CHANGED
@@ -6,24 +6,4 @@
6
6
  * ES2023 features are obviously relevant for a bundler), so stick with ES2022 for now.
7
7
  */
8
8
  export const defaultTargetSyntax = 'es2022';
9
- export const base64AssetExtensions = [
10
- '.aac',
11
- '.bmp',
12
- '.gif',
13
- '.jpeg',
14
- '.jpg',
15
- '.mp3',
16
- '.mp4',
17
- '.ogg',
18
- '.otf',
19
- '.png',
20
- '.svg',
21
- '.ttf',
22
- '.wav',
23
- '.webp',
24
- '.woff',
25
- '.woff2',
26
- '.eot',
27
- '.avif',
28
- ];
29
9
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,QAAQ,CAAC;AAE5C,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,MAAM;IACN,MAAM;IACN,MAAM;IACN,OAAO;IACP,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,OAAO;IACP,OAAO;IACP,QAAQ;IACR,MAAM;IACN,OAAO;CACR,CAAC","sourcesContent":["/**\n * Default ES syntax level. 2022 is the minimum for top-level await.\n *\n * ES2023 is probably fine for browsers (definitely for development), and Node 20 also supports it.\n * But for some reason, rspack only lists up to ES2022 in its valid targets (and none of the\n * ES2023 features are obviously relevant for a bundler), so stick with ES2022 for now.\n */\nexport const defaultTargetSyntax = 'es2022';\n\nexport const base64AssetExtensions = [\n '.aac',\n '.bmp',\n '.gif',\n '.jpeg',\n '.jpg',\n '.mp3',\n '.mp4',\n '.ogg',\n '.otf',\n '.png',\n '.svg',\n '.ttf',\n '.wav',\n '.webp',\n '.woff',\n '.woff2',\n '.eot',\n '.avif',\n];\n"]}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,QAAQ,CAAC","sourcesContent":["/**\n * Default ES syntax level. 2022 is the minimum for top-level await.\n *\n * ES2023 is probably fine for browsers (definitely for development), and Node 20 also supports it.\n * But for some reason, rspack only lists up to ES2022 in its valid targets (and none of the\n * ES2023 features are obviously relevant for a bundler), so stick with ES2022 for now.\n */\nexport const defaultTargetSyntax = 'es2022';\n"]}
package/lib/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { defaultTargetSyntax, base64AssetExtensions } from './constants.js';
1
+ export { defaultTargetSyntax } from './constants.js';
2
2
  export { getModuleSearchPaths } from './getModuleSearchPaths.js';
3
3
  export { getSwcConfig } from './getSwcConfig.js';
4
4
  export { shouldExternalizePackage } from './shouldExternalizePackage.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AACjF,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AACjF,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC"}
package/lib/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export { defaultTargetSyntax, base64AssetExtensions } from './constants.js';
1
+ export { defaultTargetSyntax } from './constants.js';
2
2
  export { getModuleSearchPaths } from './getModuleSearchPaths.js';
3
3
  export { getSwcConfig } from './getSwcConfig.js';
4
4
  export { shouldExternalizePackage } from './shouldExternalizePackage.js';
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AACjF,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC","sourcesContent":["export { defaultTargetSyntax, base64AssetExtensions } from './constants.js';\nexport { getModuleSearchPaths } from './getModuleSearchPaths.js';\nexport { getSwcConfig } from './getSwcConfig.js';\nexport { shouldExternalizePackage } from './shouldExternalizePackage.js';\nexport { getCssRule } from './getCssRule.js';\nexport { processAssetInlineExtensions } from './processAssetInlineExtensions.js';\nexport { requiresTranspile } from './requiresTranspile.js';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AACjF,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC","sourcesContent":["export { defaultTargetSyntax } from './constants.js';\nexport { getModuleSearchPaths } from './getModuleSearchPaths.js';\nexport { getSwcConfig } from './getSwcConfig.js';\nexport { shouldExternalizePackage } from './shouldExternalizePackage.js';\nexport { getCssRule } from './getCssRule.js';\nexport { processAssetInlineExtensions } from './processAssetInlineExtensions.js';\nexport { requiresTranspile } from './requiresTranspile.js';\n"]}
@@ -4,7 +4,7 @@
4
4
  * @param extensions - Can be either:
5
5
  * - Array: Replace default list with these extensions (without leading dots per documentation)
6
6
  * - Object: Modify default list (false removes, true adds extensions, without leading dots per documentation)
7
- * @returns Processed array of extensions (with leading dots, matching base64AssetExtensions format)
7
+ * @returns Processed array of extensions (with leading dots, matching `path.extname()` format)
8
8
  */
9
- export declare function processAssetInlineExtensions(extensions: string[] | Record<string, boolean>): string[];
9
+ export declare function processAssetInlineExtensions(extensions: readonly string[] | Record<string, boolean>): string[];
10
10
  //# sourceMappingURL=processAssetInlineExtensions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"processAssetInlineExtensions.d.ts","sourceRoot":"","sources":["../src/processAssetInlineExtensions.ts"],"names":[],"mappings":"AAWA;;;;;;;GAOG;AACH,wBAAgB,4BAA4B,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,EAAE,CAoBrG"}
1
+ {"version":3,"file":"processAssetInlineExtensions.d.ts","sourceRoot":"","sources":["../src/processAssetInlineExtensions.ts"],"names":[],"mappings":"AASA;;;;;;;GAOG;AACH,wBAAgB,4BAA4B,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,EAAE,CAoB9G"}
@@ -1,11 +1,9 @@
1
- import { base64AssetExtensions } from './constants.js';
1
+ import { base64AssetExtensions } from '@ms-cloudpack/path-utilities';
2
2
  /**
3
- * Normalize extension by ensuring it has a leading dot (matching base64AssetExtensions format).
4
- * Strips the dot if present in input and adds it back for consistency.
3
+ * Normalize extension by ensuring it has a leading dot (matching `path.extname()` format).
5
4
  */
6
5
  function normalizeExtension(ext) {
7
- const stripped = ext.startsWith('.') ? ext.slice(1) : ext;
8
- return `.${stripped}`;
6
+ return ext[0] === '.' ? ext : `.${ext}`;
9
7
  }
10
8
  /**
11
9
  * Process asset inline extensions based on the input format.
@@ -13,7 +11,7 @@ function normalizeExtension(ext) {
13
11
  * @param extensions - Can be either:
14
12
  * - Array: Replace default list with these extensions (without leading dots per documentation)
15
13
  * - Object: Modify default list (false removes, true adds extensions, without leading dots per documentation)
16
- * @returns Processed array of extensions (with leading dots, matching base64AssetExtensions format)
14
+ * @returns Processed array of extensions (with leading dots, matching `path.extname()` format)
17
15
  */
18
16
  export function processAssetInlineExtensions(extensions) {
19
17
  // Array format: replace the entire default list
@@ -1 +1 @@
1
- {"version":3,"file":"processAssetInlineExtensions.js","sourceRoot":"","sources":["../src/processAssetInlineExtensions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAEvD;;;GAGG;AACH,SAAS,kBAAkB,CAAC,GAAW;IACrC,MAAM,QAAQ,GAAG,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;IAC1D,OAAO,IAAI,QAAQ,EAAE,CAAC;AACxB,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,4BAA4B,CAAC,UAA8C;IACzF,gDAAgD;IAChD,IAAI,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;QAC9B,OAAO,UAAU,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;IAC5C,CAAC;IAED,yCAAyC;IACzC,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,qBAAqB,CAAC,CAAC;IAE9C,KAAK,MAAM,CAAC,GAAG,EAAE,OAAO,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;QACxD,MAAM,aAAa,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC;QAE9C,IAAI,OAAO,EAAE,CAAC;YACZ,MAAM,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QAC5B,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;QAC/B,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAC5B,CAAC","sourcesContent":["import { base64AssetExtensions } from './constants.js';\n\n/**\n * Normalize extension by ensuring it has a leading dot (matching base64AssetExtensions format).\n * Strips the dot if present in input and adds it back for consistency.\n */\nfunction normalizeExtension(ext: string): string {\n const stripped = ext.startsWith('.') ? ext.slice(1) : ext;\n return `.${stripped}`;\n}\n\n/**\n * Process asset inline extensions based on the input format.\n *\n * @param extensions - Can be either:\n * - Array: Replace default list with these extensions (without leading dots per documentation)\n * - Object: Modify default list (false removes, true adds extensions, without leading dots per documentation)\n * @returns Processed array of extensions (with leading dots, matching base64AssetExtensions format)\n */\nexport function processAssetInlineExtensions(extensions: string[] | Record<string, boolean>): string[] {\n // Array format: replace the entire default list\n if (Array.isArray(extensions)) {\n return extensions.map(normalizeExtension);\n }\n\n // Object format: modify the default list\n const result = new Set(base64AssetExtensions);\n\n for (const [ext, include] of Object.entries(extensions)) {\n const normalizedExt = normalizeExtension(ext);\n\n if (include) {\n result.add(normalizedExt);\n } else {\n result.delete(normalizedExt);\n }\n }\n\n return Array.from(result);\n}\n"]}
1
+ {"version":3,"file":"processAssetInlineExtensions.js","sourceRoot":"","sources":["../src/processAssetInlineExtensions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAErE;;GAEG;AACH,SAAS,kBAAkB,CAAC,GAAW;IACrC,OAAO,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,GAAG,EAAE,CAAC;AAC1C,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,4BAA4B,CAAC,UAAuD;IAClG,gDAAgD;IAChD,IAAI,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;QAC9B,OAAO,UAAU,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;IAC5C,CAAC;IAED,yCAAyC;IACzC,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,qBAAqB,CAAC,CAAC;IAE9C,KAAK,MAAM,CAAC,GAAG,EAAE,OAAO,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;QACxD,MAAM,aAAa,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC;QAE9C,IAAI,OAAO,EAAE,CAAC;YACZ,MAAM,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QAC5B,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;QAC/B,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAC5B,CAAC","sourcesContent":["import { base64AssetExtensions } from '@ms-cloudpack/path-utilities';\n\n/**\n * Normalize extension by ensuring it has a leading dot (matching `path.extname()` format).\n */\nfunction normalizeExtension(ext: string): string {\n return ext[0] === '.' ? ext : `.${ext}`;\n}\n\n/**\n * Process asset inline extensions based on the input format.\n *\n * @param extensions - Can be either:\n * - Array: Replace default list with these extensions (without leading dots per documentation)\n * - Object: Modify default list (false removes, true adds extensions, without leading dots per documentation)\n * @returns Processed array of extensions (with leading dots, matching `path.extname()` format)\n */\nexport function processAssetInlineExtensions(extensions: readonly string[] | Record<string, boolean>): string[] {\n // Array format: replace the entire default list\n if (Array.isArray(extensions)) {\n return extensions.map(normalizeExtension);\n }\n\n // Object format: modify the default list\n const result = new Set(base64AssetExtensions);\n\n for (const [ext, include] of Object.entries(extensions)) {\n const normalizedExt = normalizeExtension(ext);\n\n if (include) {\n result.add(normalizedExt);\n } else {\n result.delete(normalizedExt);\n }\n }\n\n return Array.from(result);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"requiresTranspile.d.ts","sourceRoot":"","sources":["../src/requiresTranspile.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAI/E;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,aAAa,EAAE,IAAI,CAAC,aAAa,EAAE,WAAW,GAAG,SAAS,GAAG,qBAAqB,CAAC,GAClF,aAAa,CAAC,mBAAmB,CAAC,CAMpC"}
1
+ {"version":3,"file":"requiresTranspile.d.ts","sourceRoot":"","sources":["../src/requiresTranspile.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAG/E;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,aAAa,EAAE,IAAI,CAAC,aAAa,EAAE,WAAW,GAAG,SAAS,GAAG,qBAAqB,CAAC,GAClF,aAAa,CAAC,mBAAmB,CAAC,CAMpC"}
@@ -1,5 +1,4 @@
1
- import { isExternalPackage, sourceExtensions } from '@ms-cloudpack/path-utilities';
2
- import path from 'path';
1
+ import { isExternalPackage, sourceRegex } from '@ms-cloudpack/path-utilities';
3
2
  /**
4
3
  * Returns whether the package needs to be transpiled before bundling (see `BundleContext.requiresTranspile`).
5
4
  *
@@ -8,6 +7,6 @@ import path from 'path';
8
7
  export function requiresTranspile(bundleOptions) {
9
8
  return (!isExternalPackage(bundleOptions.inputPath) ||
10
9
  !!bundleOptions.bundlerCapabilities?.relay ||
11
- Object.values(bundleOptions.entries).some((fileName) => sourceExtensions.includes(path.extname(fileName))));
10
+ Object.values(bundleOptions.entries).some((fileName) => sourceRegex.test(fileName)));
12
11
  }
13
12
  //# sourceMappingURL=requiresTranspile.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"requiresTranspile.js","sourceRoot":"","sources":["../src/requiresTranspile.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACnF,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAC/B,aAAmF;IAEnF,OAAO,CACL,CAAC,iBAAiB,CAAC,aAAa,CAAC,SAAS,CAAC;QAC3C,CAAC,CAAC,aAAa,CAAC,mBAAmB,EAAE,KAAK;QAC1C,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAC3G,CAAC;AACJ,CAAC","sourcesContent":["import type { BundleContext, BundleOptions } from '@ms-cloudpack/common-types';\nimport { isExternalPackage, sourceExtensions } from '@ms-cloudpack/path-utilities';\nimport path from 'path';\n\n/**\n * Returns whether the package needs to be transpiled before bundling (see `BundleContext.requiresTranspile`).\n *\n * (This is in a shared location so it can be used by tests too.)\n */\nexport function requiresTranspile(\n bundleOptions: Pick<BundleOptions, 'inputPath' | 'entries' | 'bundlerCapabilities'>,\n): BundleContext['requiresTranspile'] {\n return (\n !isExternalPackage(bundleOptions.inputPath) ||\n !!bundleOptions.bundlerCapabilities?.relay ||\n Object.values(bundleOptions.entries).some((fileName) => sourceExtensions.includes(path.extname(fileName)))\n );\n}\n"]}
1
+ {"version":3,"file":"requiresTranspile.js","sourceRoot":"","sources":["../src/requiresTranspile.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE9E;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAC/B,aAAmF;IAEnF,OAAO,CACL,CAAC,iBAAiB,CAAC,aAAa,CAAC,SAAS,CAAC;QAC3C,CAAC,CAAC,aAAa,CAAC,mBAAmB,EAAE,KAAK;QAC1C,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CACpF,CAAC;AACJ,CAAC","sourcesContent":["import type { BundleContext, BundleOptions } from '@ms-cloudpack/common-types';\nimport { isExternalPackage, sourceRegex } from '@ms-cloudpack/path-utilities';\n\n/**\n * Returns whether the package needs to be transpiled before bundling (see `BundleContext.requiresTranspile`).\n *\n * (This is in a shared location so it can be used by tests too.)\n */\nexport function requiresTranspile(\n bundleOptions: Pick<BundleOptions, 'inputPath' | 'entries' | 'bundlerCapabilities'>,\n): BundleContext['requiresTranspile'] {\n return (\n !isExternalPackage(bundleOptions.inputPath) ||\n !!bundleOptions.bundlerCapabilities?.relay ||\n Object.values(bundleOptions.entries).some((fileName) => sourceRegex.test(fileName))\n );\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ms-cloudpack/bundler-utilities",
3
- "version": "0.7.4",
3
+ "version": "0.8.0",
4
4
  "description": "Utilities used by multiple Cloudpack bundlers implementations",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -25,14 +25,14 @@
25
25
  },
26
26
  "dependencies": {
27
27
  "@ms-cloudpack/json-utilities": "^0.1.11",
28
- "@ms-cloudpack/package-utilities": "^13.2.3",
28
+ "@ms-cloudpack/package-utilities": "^13.2.5",
29
29
  "@ms-cloudpack/path-string-parsing": "^1.2.7",
30
- "@ms-cloudpack/path-utilities": "^3.2.0",
30
+ "@ms-cloudpack/path-utilities": "^3.2.2",
31
31
  "get-tsconfig": "^4.7.2",
32
32
  "tsconfig-to-swcconfig": "^2.7.0"
33
33
  },
34
34
  "devDependencies": {
35
- "@ms-cloudpack/common-types": "^0.33.0",
35
+ "@ms-cloudpack/common-types": "^0.33.1",
36
36
  "@ms-cloudpack/eslint-plugin-internal": "^0.0.1",
37
37
  "@ms-cloudpack/scripts": "^0.0.1",
38
38
  "@ms-cloudpack/test-utilities": "^0.5.0",