@ms-cloudpack/bundler-rspack 0.2.20 → 0.2.22
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/rspack.d.ts.map +1 -1
- package/lib/rspack.js +3 -1
- package/lib/rspack.js.map +1 -1
- package/package.json +6 -6
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,EAA6C,OAAO,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"rspack.d.ts","sourceRoot":"","sources":["../src/rspack.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAA6C,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAWrG,eAAO,MAAM,MAAM,EAAE,OA4CpB,CAAC"}
|
package/lib/rspack.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { processCapabilities } from '@ms-cloudpack/bundler-capabilities';
|
|
2
|
-
|
|
2
|
+
// With rspack, `version` is actually the webpack version! We need `rspackVersion` instead.
|
|
3
|
+
import { rspack as runRspack, rspackVersion } from '@rspack/core';
|
|
3
4
|
import { rspackCapabilities } from './rspackCapabilities.js';
|
|
4
5
|
import { getRspackConfiguration } from './getRspackConfiguration.js';
|
|
5
6
|
import { writeESMStubsInWorker } from '@ms-cloudpack/esm-stub-utilities';
|
|
@@ -8,6 +9,7 @@ import { base64AssetExtensions } from '@ms-cloudpack/bundler-utilities';
|
|
|
8
9
|
const bundlerName = 'rspack';
|
|
9
10
|
export const rspack = {
|
|
10
11
|
name: bundlerName,
|
|
12
|
+
version: rspackVersion,
|
|
11
13
|
bundle: async function (options, context) {
|
|
12
14
|
const { errors, newEntries } = await writeESMStubsInWorker(options);
|
|
13
15
|
if (errors?.length) {
|
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;AAEzE,OAAO,EAAE,MAAM,IAAI,SAAS,EAAyB,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"rspack.js","sourceRoot":"","sources":["../src/rspack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAEzE,2FAA2F;AAC3F,OAAO,EAAE,MAAM,IAAI,SAAS,EAAyB,aAAa,EAAE,MAAM,cAAc,CAAC;AACzF,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;AAE7B,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,CAAC;QACpE,IAAI,MAAM,EAAE,MAAM,EAAE,CAAC;YACnB,OAAO,EAAE,MAAM,EAAE,CAAC;QACpB,CAAC;QAED,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,OAAO,CAAC,SAAS,CAAC;QAE3D,MAAM,0BAA0B,GAA+B;YAC7D,wDAAwD;YACxD,cAAc,EAAE,EAAE,UAAU,EAAE,qBAAqB,EAAE;YACrD,GAAG,CAAC,OAAO,CAAC,mBAAmB,IAAI,EAAE,CAAC;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;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 { BundleMessage, BundlerCapabilitiesOptions, Bundler } 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 } 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 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 };\n\n const config = await processCapabilities({\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.2.
|
|
3
|
+
"version": "0.2.22",
|
|
4
4
|
"description": "A cloudpack plugin for abstracting rspack.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@ms-cloudpack/bundler-capabilities": "^0.2.
|
|
18
|
-
"@ms-cloudpack/bundler-utilities": "^0.1.
|
|
19
|
-
"@ms-cloudpack/common-types": "^0.24.
|
|
20
|
-
"@ms-cloudpack/esm-stub-utilities": "^0.14.
|
|
17
|
+
"@ms-cloudpack/bundler-capabilities": "^0.2.9",
|
|
18
|
+
"@ms-cloudpack/bundler-utilities": "^0.1.24",
|
|
19
|
+
"@ms-cloudpack/common-types": "^0.24.4",
|
|
20
|
+
"@ms-cloudpack/esm-stub-utilities": "^0.14.5",
|
|
21
21
|
"@ms-cloudpack/path-string-parsing": "^1.2.6",
|
|
22
|
-
"@ms-cloudpack/path-utilities": "^
|
|
22
|
+
"@ms-cloudpack/path-utilities": "^3.0.1",
|
|
23
23
|
"@rspack/core": "^1.1.8 || ^1.1.8-beta.0",
|
|
24
24
|
"@swc/core": "^1.3.0",
|
|
25
25
|
"css-loader": "^6.0.0",
|