@lynx-js/css-extract-webpack-plugin 0.6.0 → 0.6.1
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/CHANGELOG.md +6 -0
- package/lib/loader.js +1 -3
- package/lib/rspack-loader.js +10 -3
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
package/lib/loader.js
CHANGED
|
@@ -27,9 +27,7 @@ export async function load(request, addDependencies) {
|
|
|
27
27
|
if (isNamedExports(moduleExports)) {
|
|
28
28
|
Object.keys(moduleExports).forEach((key) => {
|
|
29
29
|
if (key !== 'default') {
|
|
30
|
-
|
|
31
|
-
locals = {};
|
|
32
|
-
}
|
|
30
|
+
locals ??= {};
|
|
33
31
|
locals[key] = moduleExports[key];
|
|
34
32
|
}
|
|
35
33
|
});
|
package/lib/rspack-loader.js
CHANGED
|
@@ -9,6 +9,7 @@ export async function pitch(request,
|
|
|
9
9
|
return;
|
|
10
10
|
}
|
|
11
11
|
const callback = this.async();
|
|
12
|
+
// @ts-expect-error compatible with rspack < 1.4.9
|
|
12
13
|
// See: https://github.com/web-infra-dev/rspack/pull/7878
|
|
13
14
|
const parseMeta = this.__internal__parseMeta;
|
|
14
15
|
try {
|
|
@@ -25,13 +26,19 @@ export async function pitch(request,
|
|
|
25
26
|
callback(error);
|
|
26
27
|
}
|
|
27
28
|
function addDependencies(dependencies) {
|
|
28
|
-
|
|
29
|
-
.stringify(dependencies
|
|
30
|
-
.map(dep => ({
|
|
29
|
+
const deps = JSON.stringify(dependencies.map(dep => ({
|
|
31
30
|
...dep,
|
|
32
31
|
content: dep.content.toString('utf-8'),
|
|
33
32
|
sourceMap: dep.sourceMap?.toString('utf-8'),
|
|
34
33
|
})));
|
|
34
|
+
// `this.__internal__setParseMeta` has been added in rspack 1.4.9
|
|
35
|
+
// See: https://github.com/web-infra-dev/rspack/pull/11083
|
|
36
|
+
if (typeof this.__internal__setParseMeta === 'function') {
|
|
37
|
+
this.__internal__setParseMeta(this._compiler.webpack.CssExtractRspackPlugin.pluginName, deps);
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
parseMeta[this._compiler.webpack.CssExtractRspackPlugin.pluginName] = deps;
|
|
41
|
+
}
|
|
35
42
|
}
|
|
36
43
|
}
|
|
37
44
|
export default function loader(content) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/css-extract-webpack-plugin",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"description": "This plugin extracts CSS into separate files. It creates a CSS file per JS file which contains CSS.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"webpack",
|
|
@@ -44,13 +44,13 @@
|
|
|
44
44
|
"mini-css-extract-plugin": "^2.9.2"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@microsoft/api-extractor": "7.52.
|
|
48
|
-
"@rspack/core": "1.
|
|
47
|
+
"@microsoft/api-extractor": "7.52.10",
|
|
48
|
+
"@rspack/core": "1.4.11",
|
|
49
49
|
"css-loader": "^7.1.2",
|
|
50
50
|
"sass-loader": "^16.0.5",
|
|
51
51
|
"webpack": "^5.99.9",
|
|
52
52
|
"@lynx-js/css-serializer": "0.1.3",
|
|
53
|
-
"@lynx-js/template-webpack-plugin": "0.8.
|
|
53
|
+
"@lynx-js/template-webpack-plugin": "0.8.3",
|
|
54
54
|
"@lynx-js/test-tools": "0.0.0",
|
|
55
55
|
"@lynx-js/vitest-setup": "0.0.0"
|
|
56
56
|
},
|