@ms-cloudpack/bundler 0.26.18 → 0.27.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.
package/lib/index.d.ts CHANGED
@@ -1,7 +1,3 @@
1
1
  export { bundlerNames, type BundlerCapability } from './allBundlers.js';
2
2
  export { bundle } from './bundle.js';
3
- export { isValidBundleEntry } from './isValidBundleEntry.js';
4
- export { getEntriesMapFromPackage } from './getEntriesMapFromPackage.js';
5
- export { getExternalsFromPackage } from './getExternalsFromPackage.js';
6
- export { toNormalizedEntryKey } from './toNormalizedEntryKey.js';
7
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC"}
package/lib/index.js CHANGED
@@ -1,7 +1,3 @@
1
1
  export { bundlerNames } from './allBundlers.js';
2
2
  export { bundle } from './bundle.js';
3
- export { isValidBundleEntry } from './isValidBundleEntry.js';
4
- export { getEntriesMapFromPackage } from './getEntriesMapFromPackage.js';
5
- export { getExternalsFromPackage } from './getExternalsFromPackage.js';
6
- export { toNormalizedEntryKey } from './toNormalizedEntryKey.js';
7
3
  //# 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,YAAY,EAA0B,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC","sourcesContent":["export { bundlerNames, type BundlerCapability } from './allBundlers.js';\nexport { bundle } from './bundle.js';\nexport { isValidBundleEntry } from './isValidBundleEntry.js';\nexport { getEntriesMapFromPackage } from './getEntriesMapFromPackage.js';\nexport { getExternalsFromPackage } from './getExternalsFromPackage.js';\nexport { toNormalizedEntryKey } from './toNormalizedEntryKey.js';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAA0B,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC","sourcesContent":["export { bundlerNames, type BundlerCapability } from './allBundlers.js';\nexport { bundle } from './bundle.js';\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ms-cloudpack/bundler",
3
- "version": "0.26.18",
3
+ "version": "0.27.0",
4
4
  "description": "An abstraction to bundle source code.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -24,22 +24,19 @@
24
24
  "test": "cloudpack-scripts test"
25
25
  },
26
26
  "dependencies": {
27
- "@ms-cloudpack/bundler-ori": "^0.3.10",
28
- "@ms-cloudpack/bundler-rollup": "^0.6.0",
29
- "@ms-cloudpack/bundler-rspack": "^0.5.0",
30
- "@ms-cloudpack/bundler-utilities": "^0.7.4",
31
- "@ms-cloudpack/bundler-webpack": "^0.5.0",
27
+ "@ms-cloudpack/bundler-ori": "^0.3.11",
28
+ "@ms-cloudpack/bundler-rollup": "^0.6.1",
29
+ "@ms-cloudpack/bundler-rspack": "^0.5.1",
30
+ "@ms-cloudpack/bundler-utilities": "^0.7.5",
31
+ "@ms-cloudpack/bundler-webpack": "^0.5.1",
32
32
  "@ms-cloudpack/common-types": "^0.33.0",
33
- "@ms-cloudpack/config": "^0.38.19",
34
33
  "@ms-cloudpack/json-utilities": "^0.1.11",
35
- "@ms-cloudpack/package-utilities": "^13.2.3",
36
- "@ms-cloudpack/path-string-parsing": "^1.2.7",
37
- "@ms-cloudpack/path-utilities": "^3.2.0"
34
+ "@ms-cloudpack/package-utilities": "^13.2.4",
35
+ "@ms-cloudpack/path-utilities": "^3.2.1"
38
36
  },
39
37
  "devDependencies": {
40
38
  "@ms-cloudpack/eslint-plugin-internal": "^0.0.1",
41
- "@ms-cloudpack/scripts": "^0.0.1",
42
- "@ms-cloudpack/test-utilities": "^0.5.0"
39
+ "@ms-cloudpack/scripts": "^0.0.1"
43
40
  },
44
41
  "files": [
45
42
  "lib/**/!(*.test.*)"
@@ -1,14 +0,0 @@
1
- import type { CloudpackConfig, PackageDefinitionsCache, TargetEnvironment } from '@ms-cloudpack/common-types';
2
- /**
3
- * Gets the entries map for a given package. An entries map is different from an exports map in that
4
- * the keys are relative paths to where the output should live, rather than how the entry is imported.
5
- * The data structure is used for bundler config; not for resolution of imports.
6
- */
7
- export declare function getEntriesMapFromPackage(options: {
8
- inputPath: string;
9
- targetEnvironment: TargetEnvironment;
10
- }, context: {
11
- packages: PackageDefinitionsCache;
12
- config: Pick<CloudpackConfig, 'features'>;
13
- }): Promise<Record<string, string>>;
14
- //# sourceMappingURL=getEntriesMapFromPackage.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getEntriesMapFromPackage.d.ts","sourceRoot":"","sources":["../src/getEntriesMapFromPackage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAQ9G;;;;GAIG;AACH,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE;IACP,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,EAAE,iBAAiB,CAAC;CACtC,EACD,OAAO,EAAE;IACP,QAAQ,EAAE,uBAAuB,CAAC;IAClC,MAAM,EAAE,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC;CAC3C,GACA,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAsCjC"}
@@ -1,50 +0,0 @@
1
- import { flattenExportsMap, getExportsMap } from '@ms-cloudpack/package-utilities';
2
- import { normalizeRelativePath } from '@ms-cloudpack/path-string-parsing';
3
- import { intermediateToSourcePath, isExternalPackage } from '@ms-cloudpack/path-utilities';
4
- import path from 'path';
5
- import { isValidBundleEntry } from './isValidBundleEntry.js';
6
- import { toNormalizedEntryKey } from './toNormalizedEntryKey.js';
7
- /**
8
- * Gets the entries map for a given package. An entries map is different from an exports map in that
9
- * the keys are relative paths to where the output should live, rather than how the entry is imported.
10
- * The data structure is used for bundler config; not for resolution of imports.
11
- */
12
- export async function getEntriesMapFromPackage(options, context) {
13
- const { inputPath, targetEnvironment } = options;
14
- const isInternal = !isExternalPackage(inputPath);
15
- const exportsMap = await getExportsMap({ packagePath: inputPath }, context);
16
- const flattenedMap = flattenExportsMap(exportsMap, {
17
- conditions: `${targetEnvironment}-defaults`,
18
- });
19
- let sourceExportsMap;
20
- // The flattened map values tell us what physical files will show up in the import map on the page. We use these
21
- // as the keys for the entries map, which results in physical file output from the bundler.
22
- // For internal packages, we want the values (the inputs to the each entry) to use source paths if available. To
23
- // get these, we can either derive from exports map "source" entries, or if those are not available, we can attempt
24
- // to derive source paths from intermediate paths.
25
- if (isInternal) {
26
- sourceExportsMap = flattenExportsMap(exportsMap, {
27
- // Allow traversing into targetEnvironment conditions to find 'source' conditions
28
- conditions: [targetEnvironment, 'source'],
29
- requiredConditions: ['source'],
30
- });
31
- for (const [key, value] of Object.entries(flattenedMap)) {
32
- if (!sourceExportsMap[key]) {
33
- sourceExportsMap[key] = intermediateToSourcePath(value, inputPath) || value;
34
- }
35
- }
36
- }
37
- return Object.fromEntries(Object.entries(flattenedMap)
38
- .filter(([, value]) => isValidBundleEntry(value))
39
- .map(([key, value]) => [
40
- toNormalizedEntryKey(value),
41
- toNormalizedRelativePath(inputPath, sourceExportsMap?.[key] || value),
42
- ]));
43
- }
44
- function toNormalizedRelativePath(inputPath, entry) {
45
- if (path.isAbsolute(entry)) {
46
- entry = path.relative(inputPath, entry);
47
- }
48
- return normalizeRelativePath(entry);
49
- }
50
- //# sourceMappingURL=getEntriesMapFromPackage.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getEntriesMapFromPackage.js","sourceRoot":"","sources":["../src/getEntriesMapFromPackage.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AACnF,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAC3F,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAC5C,OAGC,EACD,OAGC;IAED,MAAM,EAAE,SAAS,EAAE,iBAAiB,EAAE,GAAG,OAAO,CAAC;IACjD,MAAM,UAAU,GAAG,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC;IACjD,MAAM,UAAU,GAAG,MAAM,aAAa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CAAC,KAAK,CAAC,EAAE,CAAC;QAC3B,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;IAC1C,CAAC;IAED,OAAO,qBAAqB,CAAC,KAAK,CAAC,CAAC;AACtC,CAAC","sourcesContent":["import type { CloudpackConfig, PackageDefinitionsCache, TargetEnvironment } from '@ms-cloudpack/common-types';\nimport { flattenExportsMap, getExportsMap } from '@ms-cloudpack/package-utilities';\nimport { normalizeRelativePath } from '@ms-cloudpack/path-string-parsing';\nimport { intermediateToSourcePath, isExternalPackage } from '@ms-cloudpack/path-utilities';\nimport path from 'path';\nimport { isValidBundleEntry } from './isValidBundleEntry.js';\nimport { toNormalizedEntryKey } from './toNormalizedEntryKey.js';\n\n/**\n * Gets the entries map for a given package. An entries map is different from an exports map in that\n * the keys are relative paths to where the output should live, rather than how the entry is imported.\n * The data structure is used for bundler config; not for resolution of imports.\n */\nexport async function getEntriesMapFromPackage(\n options: {\n inputPath: string;\n targetEnvironment: TargetEnvironment;\n },\n context: {\n packages: PackageDefinitionsCache;\n config: Pick<CloudpackConfig, 'features'>;\n },\n): Promise<Record<string, string>> {\n const { inputPath, targetEnvironment } = options;\n const isInternal = !isExternalPackage(inputPath);\n const exportsMap = await getExportsMap({ packagePath: inputPath }, context);\n const flattenedMap = flattenExportsMap(exportsMap, {\n conditions: `${targetEnvironment}-defaults`,\n });\n let sourceExportsMap: Record<string, string>;\n\n // The flattened map values tell us what physical files will show up in the import map on the page. We use these\n // as the keys for the entries map, which results in physical file output from the bundler.\n\n // For internal packages, we want the values (the inputs to the each entry) to use source paths if available. To\n // get these, we can either derive from exports map \"source\" entries, or if those are not available, we can attempt\n // to derive source paths from intermediate paths.\n\n if (isInternal) {\n sourceExportsMap = flattenExportsMap(exportsMap, {\n // Allow traversing into targetEnvironment conditions to find 'source' conditions\n conditions: [targetEnvironment, 'source'],\n requiredConditions: ['source'],\n });\n\n for (const [key, value] of Object.entries(flattenedMap)) {\n if (!sourceExportsMap[key]) {\n sourceExportsMap[key] = intermediateToSourcePath(value, inputPath) || value;\n }\n }\n }\n\n return Object.fromEntries(\n Object.entries(flattenedMap)\n .filter(([, value]) => isValidBundleEntry(value))\n .map(([key, value]) => [\n toNormalizedEntryKey(value),\n toNormalizedRelativePath(inputPath, sourceExportsMap?.[key] || value),\n ]),\n );\n}\n\nfunction toNormalizedRelativePath(inputPath: string, entry: string): string {\n if (path.isAbsolute(entry)) {\n entry = path.relative(inputPath, entry);\n }\n\n return normalizeRelativePath(entry);\n}\n"]}
@@ -1,14 +0,0 @@
1
- import type { PackageDefinitionsCache } from '@ms-cloudpack/common-types';
2
- /**
3
- * Reads a package definition and derives a flat array of dependencies to externalize for bundling.
4
- *
5
- * To reduce the chances of accidentally bundling something that should be external, this includes
6
- * the names of original dependencies of all types (prior to transforms), as well as any
7
- * `includedDependencies` from config that were added by `createPackageSettingsTransform`.
8
- */
9
- export declare function getExternalsFromPackage(options: {
10
- inputPath: string;
11
- }, context: {
12
- packages: PackageDefinitionsCache;
13
- }): Promise<string[]>;
14
- //# sourceMappingURL=getExternalsFromPackage.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getExternalsFromPackage.d.ts","sourceRoot":"","sources":["../src/getExternalsFromPackage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAG1E;;;;;;GAMG;AACH,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE;IACP,SAAS,EAAE,MAAM,CAAC;CACnB,EACD,OAAO,EAAE;IACP,QAAQ,EAAE,uBAAuB,CAAC;CACnC,GACA,OAAO,CAAC,MAAM,EAAE,CAAC,CAgBnB"}
@@ -1,25 +0,0 @@
1
- import { getDependencies } from '@ms-cloudpack/package-utilities';
2
- /**
3
- * Reads a package definition and derives a flat array of dependencies to externalize for bundling.
4
- *
5
- * To reduce the chances of accidentally bundling something that should be external, this includes
6
- * the names of original dependencies of all types (prior to transforms), as well as any
7
- * `includedDependencies` from config that were added by `createPackageSettingsTransform`.
8
- */
9
- export async function getExternalsFromPackage(options, context) {
10
- const { inputPath } = options;
11
- const { packages } = context;
12
- const transformedDefinition = await packages.get(inputPath);
13
- const originalDefinition = await packages.get(inputPath, { disableTransforms: true });
14
- return Object.keys({
15
- // Use mostly original dependencies in case of removals by createPackageSettingsTransform.
16
- ...getDependencies(originalDefinition, { includeAll: true }),
17
- // peerDependenciesMeta names should be redundant with peerDependencies.
18
- // But in rare cases (debug@4), it may incorrectly include deps that aren't listed elsewhere...
19
- // Include them just in case, since we want to externalize as many things as possible.
20
- ...originalDefinition.peerDependenciesMeta,
21
- // Also use the transformed deps in case any includedDependencies weren't listed in orignal deps.
22
- ...transformedDefinition.dependencies,
23
- });
24
- }
25
- //# sourceMappingURL=getExternalsFromPackage.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getExternalsFromPackage.js","sourceRoot":"","sources":["../src/getExternalsFromPackage.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAElE;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,OAEC,EACD,OAEC;IAED,MAAM,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;IAC9B,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;IAC7B,MAAM,qBAAqB,GAAG,MAAM,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAC5D,MAAM,kBAAkB,GAAG,MAAM,QAAQ,CAAC,GAAG,CAAC,SAAS,EAAE,EAAE,iBAAiB,EAAE,IAAI,EAAE,CAAC,CAAC;IAEtF,OAAO,MAAM,CAAC,IAAI,CAAC;QACjB,0FAA0F;QAC1F,GAAG,eAAe,CAAC,kBAAkB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC;QAC5D,wEAAwE;QACxE,+FAA+F;QAC/F,sFAAsF;QACtF,GAAG,kBAAkB,CAAC,oBAAoB;QAC1C,iGAAiG;QACjG,GAAG,qBAAqB,CAAC,YAAY;KACtC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { PackageDefinitionsCache } from '@ms-cloudpack/common-types';\nimport { getDependencies } from '@ms-cloudpack/package-utilities';\n\n/**\n * Reads a package definition and derives a flat array of dependencies to externalize for bundling.\n *\n * To reduce the chances of accidentally bundling something that should be external, this includes\n * the names of original dependencies of all types (prior to transforms), as well as any\n * `includedDependencies` from config that were added by `createPackageSettingsTransform`.\n */\nexport async function getExternalsFromPackage(\n options: {\n inputPath: string;\n },\n context: {\n packages: PackageDefinitionsCache;\n },\n): Promise<string[]> {\n const { inputPath } = options;\n const { packages } = context;\n const transformedDefinition = await packages.get(inputPath);\n const originalDefinition = await packages.get(inputPath, { disableTransforms: true });\n\n return Object.keys({\n // Use mostly original dependencies in case of removals by createPackageSettingsTransform.\n ...getDependencies(originalDefinition, { includeAll: true }),\n // peerDependenciesMeta names should be redundant with peerDependencies.\n // But in rare cases (debug@4), it may incorrectly include deps that aren't listed elsewhere...\n // Include them just in case, since we want to externalize as many things as possible.\n ...originalDefinition.peerDependenciesMeta,\n // Also use the transformed deps in case any includedDependencies weren't listed in orignal deps.\n ...transformedDefinition.dependencies,\n });\n}\n"]}
@@ -1,9 +0,0 @@
1
- /**
2
- * Returns true if the file path is a valid bundle-able file extension. This is used to filter exports maps out
3
- * to ensure we prevent trying to bundle things that bundlers don't support. We can bundle things like TS,
4
- * JS, CSS, SCSS, JSON, and even text extensions like .txt and .html. These formats all will produce javascript
5
- * modules. "Valid" is defined by what the bundler abstraction expects. In the future we may want this code to be
6
- * provided by the plugin itself so that it owns what's "supported".
7
- */
8
- export declare function isValidBundleEntry(filePath: string): boolean;
9
- //# sourceMappingURL=isValidBundleEntry.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"isValidBundleEntry.d.ts","sourceRoot":"","sources":["../src/isValidBundleEntry.ts"],"names":[],"mappings":"AA0BA;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAS5D"}
@@ -1,39 +0,0 @@
1
- import { sourceExtensions } from '@ms-cloudpack/path-utilities';
2
- import path from 'path';
3
- const resourceExtensions = [
4
- '.bmp',
5
- '.gif',
6
- '.jpeg',
7
- '.jpg',
8
- '.mp3',
9
- '.mp4',
10
- '.otf',
11
- '.png',
12
- '.svg',
13
- '.ttf',
14
- '.webp',
15
- '.woff',
16
- '.woff2',
17
- ];
18
- const nonJsSourceExtensions = ['.json', '.css', '.scss', '.wasm'];
19
- const textExtensions = ['.htm', '.html', '.txt'];
20
- const supportedExtensions = [...resourceExtensions, ...sourceExtensions, ...nonJsSourceExtensions, ...textExtensions];
21
- // Note: excluded extensions only need to contain things that are allowed by supportedExtensions but using
22
- // an extended syntax that we don't want to support. For example, we want to support .ts files but not .d.ts.
23
- const excludedExtensions = ['.d.ts'];
24
- /**
25
- * Returns true if the file path is a valid bundle-able file extension. This is used to filter exports maps out
26
- * to ensure we prevent trying to bundle things that bundlers don't support. We can bundle things like TS,
27
- * JS, CSS, SCSS, JSON, and even text extensions like .txt and .html. These formats all will produce javascript
28
- * modules. "Valid" is defined by what the bundler abstraction expects. In the future we may want this code to be
29
- * provided by the plugin itself so that it owns what's "supported".
30
- */
31
- export function isValidBundleEntry(filePath) {
32
- const isSupported = supportedExtensions.includes(path.extname(filePath).toLowerCase());
33
- const isExcluded = excludedExtensions.some((excludedExt) => filePath.endsWith(excludedExt)) ||
34
- // Exclude files that start with an underscore, as they are typically partials or other non-entry files.
35
- // https://sass-lang.com/documentation/at-rules/import/#partials
36
- (path.basename(filePath).startsWith('_') && path.extname(filePath).toLowerCase() === '.scss');
37
- return isSupported && !isExcluded;
38
- }
39
- //# sourceMappingURL=isValidBundleEntry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"isValidBundleEntry.js","sourceRoot":"","sources":["../src/isValidBundleEntry.ts"],"names":[],"mappings":"AAAA,OAAO,EAA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ions = [\n '.bmp',\n '.gif',\n '.jpeg',\n '.jpg',\n '.mp3',\n '.mp4',\n '.otf',\n '.png',\n '.svg',\n '.ttf',\n '.webp',\n '.woff',\n '.woff2',\n];\nconst nonJsSourceExtensions = ['.json', '.css', '.scss', '.wasm'];\nconst textExtensions = ['.htm', '.html', '.txt'];\nconst supportedExtensions = [...resourceExtensions, ...sourceExtensions, ...nonJsSourceExtensions, ...textExtensions];\n\n// Note: excluded extensions only need to contain things that are allowed by supportedExtensions but using\n// an extended syntax that we don't want to support. For example, we want to support .ts files but not .d.ts.\nconst excludedExtensions = ['.d.ts'];\n\n/**\n * Returns true if the file path is a valid bundle-able file extension. This is used to filter exports maps out\n * to ensure we prevent trying to bundle things that bundlers don't support. We can bundle things like TS,\n * JS, CSS, SCSS, JSON, and even text extensions like .txt and .html. These formats all will produce javascript\n * modules. \"Valid\" is defined by what the bundler abstraction expects. In the future we may want this code to be\n * provided by the plugin itself so that it owns what's \"supported\".\n */\nexport function isValidBundleEntry(filePath: string): boolean {\n const isSupported = supportedExtensions.includes(path.extname(filePath).toLowerCase());\n const isExcluded =\n excludedExtensions.some((excludedExt) => filePath.endsWith(excludedExt)) ||\n // Exclude files that start with an underscore, as they are typically partials or other non-entry files.\n // https://sass-lang.com/documentation/at-rules/import/#partials\n (path.basename(filePath).startsWith('_') && path.extname(filePath).toLowerCase() === '.scss');\n\n return isSupported && !isExcluded;\n}\n"]}
@@ -1,6 +0,0 @@
1
- /**
2
- * When we derive keys, we want to preserve unknown script extensions. For others, remove them as the bundler
3
- * will add back `'.js'` for us in the output.
4
- */
5
- export declare function toNormalizedEntryKey(entry: string): string;
6
- //# sourceMappingURL=toNormalizedEntryKey.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"toNormalizedEntryKey.d.ts","sourceRoot":"","sources":["../src/toNormalizedEntryKey.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAO1D"}
@@ -1,14 +0,0 @@
1
- import { sourceExtensions } from '@ms-cloudpack/path-utilities';
2
- import path from 'path';
3
- /**
4
- * When we derive keys, we want to preserve unknown script extensions. For others, remove them as the bundler
5
- * will add back `'.js'` for us in the output.
6
- */
7
- export function toNormalizedEntryKey(entry) {
8
- const extension = path.extname(entry);
9
- if (sourceExtensions.includes(extension)) {
10
- return entry.slice(0, -extension.length);
11
- }
12
- return entry;
13
- }
14
- //# sourceMappingURL=toNormalizedEntryKey.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"toNormalizedEntryKey.js","sourceRoot":"","sources":["../src/toNormalizedEntryKey.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAAC,KAAa;IAChD,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACtC,IAAI,gBAAgB,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;QACzC,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAC3C,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["import { sourceExtensions } from '@ms-cloudpack/path-utilities';\nimport path from 'path';\n\n/**\n * When we derive keys, we want to preserve unknown script extensions. For others, remove them as the bundler\n * will add back `'.js'` for us in the output.\n */\nexport function toNormalizedEntryKey(entry: string): string {\n const extension = path.extname(entry);\n if (sourceExtensions.includes(extension)) {\n return entry.slice(0, -extension.length);\n }\n\n return entry;\n}\n"]}