@ms-cloudpack/bundler-utilities 0.7.3 → 0.7.4
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/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/requiresTranspile.d.ts +8 -0
- package/lib/requiresTranspile.d.ts.map +1 -0
- package/lib/requiresTranspile.js +13 -0
- package/lib/requiresTranspile.js.map +1 -0
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -4,4 +4,5 @@ export { getSwcConfig } from './getSwcConfig.js';
|
|
|
4
4
|
export { shouldExternalizePackage } from './shouldExternalizePackage.js';
|
|
5
5
|
export { getCssRule } from './getCssRule.js';
|
|
6
6
|
export { processAssetInlineExtensions } from './processAssetInlineExtensions.js';
|
|
7
|
+
export { requiresTranspile } from './requiresTranspile.js';
|
|
7
8
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -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"}
|
|
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"}
|
package/lib/index.js
CHANGED
|
@@ -4,4 +4,5 @@ export { getSwcConfig } from './getSwcConfig.js';
|
|
|
4
4
|
export { shouldExternalizePackage } from './shouldExternalizePackage.js';
|
|
5
5
|
export { getCssRule } from './getCssRule.js';
|
|
6
6
|
export { processAssetInlineExtensions } from './processAssetInlineExtensions.js';
|
|
7
|
+
export { requiresTranspile } from './requiresTranspile.js';
|
|
7
8
|
//# sourceMappingURL=index.js.map
|
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","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';\n"]}
|
|
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"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { BundleContext, BundleOptions } from '@ms-cloudpack/common-types';
|
|
2
|
+
/**
|
|
3
|
+
* Returns whether the package needs to be transpiled before bundling (see `BundleContext.requiresTranspile`).
|
|
4
|
+
*
|
|
5
|
+
* (This is in a shared location so it can be used by tests too.)
|
|
6
|
+
*/
|
|
7
|
+
export declare function requiresTranspile(bundleOptions: Pick<BundleOptions, 'inputPath' | 'entries' | 'bundlerCapabilities'>): BundleContext['requiresTranspile'];
|
|
8
|
+
//# sourceMappingURL=requiresTranspile.d.ts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { isExternalPackage, sourceExtensions } from '@ms-cloudpack/path-utilities';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
/**
|
|
4
|
+
* Returns whether the package needs to be transpiled before bundling (see `BundleContext.requiresTranspile`).
|
|
5
|
+
*
|
|
6
|
+
* (This is in a shared location so it can be used by tests too.)
|
|
7
|
+
*/
|
|
8
|
+
export function requiresTranspile(bundleOptions) {
|
|
9
|
+
return (!isExternalPackage(bundleOptions.inputPath) ||
|
|
10
|
+
!!bundleOptions.bundlerCapabilities?.relay ||
|
|
11
|
+
Object.values(bundleOptions.entries).some((fileName) => sourceExtensions.includes(path.extname(fileName))));
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=requiresTranspile.js.map
|
|
@@ -0,0 +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"]}
|