@ms-cloudpack/bundler-rspack 0.4.4 → 0.4.5
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 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/rspack.d.ts +2 -0
- package/lib/rspack.d.ts.map +1 -1
- package/lib/rspack.js.map +1 -1
- package/package.json +15 -15
package/lib/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { rspack as default } from './rspack.js';
|
|
1
|
+
export { rspack as default, type RspackCapabilityConfig } from './rspack.js';
|
|
2
2
|
//# 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,MAAM,IAAI,OAAO,EAAE,MAAM,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,aAAa,CAAC"}
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,OAAO,EAA+B,MAAM,aAAa,CAAC","sourcesContent":["export { rspack as default, type RspackCapabilityConfig } from './rspack.js';\n"]}
|
package/lib/rspack.d.ts
CHANGED
package/lib/rspack.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rspack.d.ts","sourceRoot":"","sources":["../src/rspack.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"rspack.d.ts","sourceRoot":"","sources":["../src/rspack.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAGV,OAAO,EAER,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAA6D,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAS7G,MAAM,MAAM,sBAAsB,GAAG,aAAa,CAAC;AAEnD,eAAO,MAAM,MAAM,EAAE,OA4CpB,CAAC"}
|
package/lib/rspack.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rspack.js","sourceRoot":"","sources":["../src/rspack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"rspack.js","sourceRoot":"","sources":["../src/rspack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAOzE,2FAA2F;AAC3F,OAAO,EAAE,MAAM,IAAI,SAAS,EAAyB,aAAa,EAAsB,MAAM,cAAc,CAAC;AAC7G,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAExE,MAAM,WAAW,GAAG,QAAQ,CAAC;AAI7B,MAAM,CAAC,MAAM,MAAM,GAAY;IAC7B,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE,aAAa;IACtB,MAAM,EAAE,KAAK,WAAW,OAAO,EAAE,OAAO;QACtC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,qBAAqB,CAAC,OAAO,CAAC,CA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,IAAI,GAAG,CAAC,KAAK,EAAE,CAAC;gBACtC,oCAAoC;gBACpC,YAAY,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,EAAE,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC;YACjH,CAAC;YACD,OAAO;gBACL,MAAM,EAAE,CAAC,YAAY,CAAC;gBACtB,QAAQ,EAAE,MAAiC;aAC5C,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAC","sourcesContent":["import { processCapabilities } from '@ms-cloudpack/bundler-capabilities';\nimport type {\n BundleMessage,\n BundlerCapabilitiesOptions,\n Bundler,\n InternalBundlerCapabilitiesOptions,\n} from '@ms-cloudpack/common-types';\n// With rspack, `version` is actually the webpack version! We need `rspackVersion` instead.\nimport { rspack as runRspack, type StatsCompilation, rspackVersion, type RspackOptions } from '@rspack/core';\nimport { rspackCapabilities } from './rspackCapabilities.js';\nimport { getRspackConfiguration } from './getRspackConfiguration.js';\nimport { writeESMStubsInWorker } from '@ms-cloudpack/esm-stub-utilities';\nimport { normalizeRspackOutput } from './normalizeRspackOutput.js';\nimport { base64AssetExtensions } from '@ms-cloudpack/bundler-utilities';\n\nconst bundlerName = 'rspack';\n\nexport type RspackCapabilityConfig = RspackOptions;\n\nexport const rspack: Bundler = {\n name: bundlerName,\n version: rspackVersion,\n bundle: async function (options, context) {\n const { errors, newEntries } = await writeESMStubsInWorker(options);\n if (errors?.length) {\n return { errors };\n }\n\n const outputPath = options.outputPath ?? options.inputPath;\n\n const bundlerCapabilitiesOptions: BundlerCapabilitiesOptions = {\n // Enable asset-inline by default for common image types\n 'asset-inline': { extensions: base64AssetExtensions },\n ...(options.bundlerCapabilities || {}),\n } satisfies InternalBundlerCapabilitiesOptions;\n\n const config = await processCapabilities<RspackCapabilityConfig>({\n bundlerName,\n baseConfig: getRspackConfiguration({ options, outputPath, newEntries }, context),\n bundlerCapabilitiesOptions,\n internalCapabilities: rspackCapabilities,\n bundlerCapabilitiesRegistry: context.config.bundlerCapabilitiesRegistry,\n });\n\n try {\n const stats = await new Promise<StatsCompilation | undefined>((resolve, reject) => {\n runRspack(config, (err, statsResult) => (err ? reject(err) : resolve(statsResult?.toJson())));\n });\n\n // Normalize the output outside the callback, so if there's an exception it's not swallowed\n return normalizeRspackOutput({ stats, config, outputPath, options });\n } catch (err) {\n const errorMessage: BundleMessage = { text: (err as Error).message || String(err), source: bundlerName };\n if (err instanceof Error && err.stack) {\n // remove the message from the stack\n errorMessage.notes = [{ text: err.stack.includes(err.message) ? err.stack.split(err.message)[1] : err.stack }];\n }\n return {\n errors: [errorMessage],\n rawInput: config as Record<string, unknown>,\n };\n }\n },\n};\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ms-cloudpack/bundler-rspack",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.5",
|
|
4
4
|
"description": "Cloudpack's wrapper for the Rspack bundler",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -13,13 +13,23 @@
|
|
|
13
13
|
"import": "./lib/index.js"
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
|
+
"scripts": {
|
|
17
|
+
"api": "cloudpack-scripts api",
|
|
18
|
+
"build:watch": "cloudpack-scripts build-watch",
|
|
19
|
+
"build": "cloudpack-scripts build",
|
|
20
|
+
"lint:update": "cloudpack-scripts lint-update",
|
|
21
|
+
"lint": "cloudpack-scripts lint",
|
|
22
|
+
"test:update": "cloudpack-scripts test-update",
|
|
23
|
+
"test:watch": "cloudpack-scripts test-watch",
|
|
24
|
+
"test": "cloudpack-scripts test"
|
|
25
|
+
},
|
|
16
26
|
"dependencies": {
|
|
17
27
|
"@ms-cloudpack/bundler-capabilities": "^0.4.8",
|
|
18
|
-
"@ms-cloudpack/bundler-utilities": "^0.7.
|
|
19
|
-
"@ms-cloudpack/common-types": "^0.
|
|
20
|
-
"@ms-cloudpack/esm-stub-utilities": "^0.15.
|
|
28
|
+
"@ms-cloudpack/bundler-utilities": "^0.7.3",
|
|
29
|
+
"@ms-cloudpack/common-types": "^0.33.0",
|
|
30
|
+
"@ms-cloudpack/esm-stub-utilities": "^0.15.33",
|
|
21
31
|
"@ms-cloudpack/path-string-parsing": "^1.2.7",
|
|
22
|
-
"@ms-cloudpack/path-utilities": "^3.
|
|
32
|
+
"@ms-cloudpack/path-utilities": "^3.2.0",
|
|
23
33
|
"@rspack/core": "^1.1.8 || ^1.1.8-beta.0",
|
|
24
34
|
"@swc/core": "^1.3.0",
|
|
25
35
|
"@swc/plugin-relay": "^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0",
|
|
@@ -39,16 +49,6 @@
|
|
|
39
49
|
"@ms-cloudpack/scripts": "^0.0.1",
|
|
40
50
|
"@ms-cloudpack/test-utilities": "^0.5.0"
|
|
41
51
|
},
|
|
42
|
-
"scripts": {
|
|
43
|
-
"api": "cloudpack-scripts api",
|
|
44
|
-
"build:watch": "cloudpack-scripts build-watch",
|
|
45
|
-
"build": "cloudpack-scripts build",
|
|
46
|
-
"lint:update": "cloudpack-scripts lint-update",
|
|
47
|
-
"lint": "cloudpack-scripts lint",
|
|
48
|
-
"test:update": "cloudpack-scripts test-update",
|
|
49
|
-
"test:watch": "cloudpack-scripts test-watch",
|
|
50
|
-
"test": "cloudpack-scripts test"
|
|
51
|
-
},
|
|
52
52
|
"files": [
|
|
53
53
|
"lib/**/!(*.test.*)"
|
|
54
54
|
]
|