@esmx/rspack-vue 3.0.0-rc.35 → 3.0.0-rc.37
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/dist/vue-core.mjs +9 -4
- package/dist/vue2-loader.mjs +2 -1
- package/dist/vue3-loader.mjs +2 -1
- package/package.json +8 -8
- package/src/vue-core.ts +9 -6
- package/src/vue2-loader.ts +2 -2
- package/src/vue3-loader.ts +2 -2
package/dist/vue-core.mjs
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
import { fileURLToPath } from "node:url";
|
|
1
2
|
import { createRspackHtmlApp, rspack } from "@esmx/rspack";
|
|
2
|
-
import { VueLoaderPlugin as VueLoader2Plugin } from "
|
|
3
|
-
import { VueLoaderPlugin as VueLoader3Plugin } from "
|
|
3
|
+
import { VueLoaderPlugin as VueLoader2Plugin } from "vue-loader-v15";
|
|
4
|
+
import { VueLoaderPlugin as VueLoader3Plugin } from "vue-loader-v17";
|
|
4
5
|
import { vue2Loader } from "./vue2-loader.mjs";
|
|
5
6
|
import { vue3Loader } from "./vue3-loader.mjs";
|
|
6
7
|
export function createRspackVueApp(esmx, vueType, options) {
|
|
7
8
|
return createRspackHtmlApp(esmx, {
|
|
8
9
|
...options,
|
|
9
10
|
loaders: {
|
|
10
|
-
styleLoader:
|
|
11
|
+
styleLoader: fileURLToPath(import.meta.resolve("vue-style-loader")),
|
|
11
12
|
...options?.loaders
|
|
12
13
|
},
|
|
13
14
|
config(context) {
|
|
@@ -34,7 +35,11 @@ export function createRspackVueApp(esmx, vueType, options) {
|
|
|
34
35
|
}
|
|
35
36
|
const vueRuleUse = [
|
|
36
37
|
{
|
|
37
|
-
loader:
|
|
38
|
+
loader: fileURLToPath(
|
|
39
|
+
import.meta.resolve(
|
|
40
|
+
`vue-loader-v${vueType === "2" ? "15" : "17"}`
|
|
41
|
+
)
|
|
42
|
+
),
|
|
38
43
|
options: {
|
|
39
44
|
...options?.vueLoader,
|
|
40
45
|
experimentalInlineMatchResource: true,
|
package/dist/vue2-loader.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { fileURLToPath } from "node:url";
|
|
1
2
|
const FIX_ESM = `api.install(require('vue').default)`;
|
|
2
3
|
const ADD_IMPORT = `
|
|
3
4
|
function initImport () {
|
|
@@ -19,4 +20,4 @@ export default function(text) {
|
|
|
19
20
|
}
|
|
20
21
|
return text;
|
|
21
22
|
}
|
|
22
|
-
export const vue2Loader =
|
|
23
|
+
export const vue2Loader = fileURLToPath(import.meta.resolve(import.meta.url));
|
package/dist/vue3-loader.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { fileURLToPath } from "node:url";
|
|
1
2
|
const ADD_IMPORT = `
|
|
2
3
|
import { useSSRContext } from 'vue';
|
|
3
4
|
function initImport () {
|
|
@@ -16,4 +17,4 @@ initImport();
|
|
|
16
17
|
export default function(text) {
|
|
17
18
|
return text + ADD_IMPORT;
|
|
18
19
|
}
|
|
19
|
-
export const vue3Loader =
|
|
20
|
+
export const vue3Loader = fileURLToPath(import.meta.resolve(import.meta.url));
|
package/package.json
CHANGED
|
@@ -56,15 +56,15 @@
|
|
|
56
56
|
"vue": ">=2.7.8 || >=3.0.0"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@esmx/rspack": "3.0.0-rc.
|
|
60
|
-
"vue-
|
|
61
|
-
"
|
|
62
|
-
"
|
|
59
|
+
"@esmx/rspack": "3.0.0-rc.37",
|
|
60
|
+
"vue-loader-v15": "npm:vue-loader@15.11.1",
|
|
61
|
+
"vue-loader-v17": "npm:vue-loader@^17.4.2",
|
|
62
|
+
"vue-style-loader": "^4.1.3"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
65
|
"@biomejs/biome": "1.9.4",
|
|
66
|
-
"@esmx/core": "3.0.0-rc.
|
|
67
|
-
"@esmx/lint": "3.0.0-rc.
|
|
66
|
+
"@esmx/core": "3.0.0-rc.37",
|
|
67
|
+
"@esmx/lint": "3.0.0-rc.37",
|
|
68
68
|
"@types/node": "^24.0.0",
|
|
69
69
|
"@vitest/coverage-v8": "3.2.4",
|
|
70
70
|
"stylelint": "16.21.0",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"unbuild": "3.5.0",
|
|
73
73
|
"vitest": "3.2.4"
|
|
74
74
|
},
|
|
75
|
-
"version": "3.0.0-rc.
|
|
75
|
+
"version": "3.0.0-rc.37",
|
|
76
76
|
"type": "module",
|
|
77
77
|
"private": false,
|
|
78
78
|
"exports": {
|
|
@@ -91,5 +91,5 @@
|
|
|
91
91
|
"template",
|
|
92
92
|
"public"
|
|
93
93
|
],
|
|
94
|
-
"gitHead": "
|
|
94
|
+
"gitHead": "ca2747fe29a9a48b942dfd9bf5a99742211afd3f"
|
|
95
95
|
}
|
package/src/vue-core.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { fileURLToPath } from 'node:url';
|
|
1
2
|
import type { Esmx } from '@esmx/core';
|
|
2
3
|
import { createRspackHtmlApp, rspack } from '@esmx/rspack';
|
|
3
|
-
import { VueLoaderPlugin as VueLoader2Plugin } from '
|
|
4
|
-
import { VueLoaderPlugin as VueLoader3Plugin } from '
|
|
4
|
+
import { VueLoaderPlugin as VueLoader2Plugin } from 'vue-loader-v15';
|
|
5
|
+
import { VueLoaderPlugin as VueLoader3Plugin } from 'vue-loader-v17';
|
|
5
6
|
import type { RspackVueAppOptions } from './vue';
|
|
6
7
|
import { vue2Loader } from './vue2-loader';
|
|
7
8
|
import { vue3Loader } from './vue3-loader';
|
|
@@ -16,8 +17,7 @@ export function createRspackVueApp(
|
|
|
16
17
|
return createRspackHtmlApp(esmx, {
|
|
17
18
|
...options,
|
|
18
19
|
loaders: {
|
|
19
|
-
styleLoader:
|
|
20
|
-
.pathname,
|
|
20
|
+
styleLoader: fileURLToPath(import.meta.resolve('vue-style-loader')),
|
|
21
21
|
...options?.loaders
|
|
22
22
|
},
|
|
23
23
|
config(context) {
|
|
@@ -48,8 +48,11 @@ export function createRspackVueApp(
|
|
|
48
48
|
// 设置 vue-loader
|
|
49
49
|
const vueRuleUse: rspack.RuleSetUse = [
|
|
50
50
|
{
|
|
51
|
-
loader:
|
|
52
|
-
.
|
|
51
|
+
loader: fileURLToPath(
|
|
52
|
+
import.meta.resolve(
|
|
53
|
+
`vue-loader-v${vueType === '2' ? '15' : '17'}`
|
|
54
|
+
)
|
|
55
|
+
),
|
|
53
56
|
options: {
|
|
54
57
|
...options?.vueLoader,
|
|
55
58
|
experimentalInlineMatchResource: true,
|
package/src/vue2-loader.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { fileURLToPath } from 'node:url';
|
|
1
2
|
import type { rspack } from '@esmx/rspack';
|
|
2
3
|
const FIX_ESM = `api.install(require('vue').default)`;
|
|
3
4
|
const ADD_IMPORT = `
|
|
@@ -24,5 +25,4 @@ export default function (this: rspack.LoaderContext, text: string) {
|
|
|
24
25
|
return text;
|
|
25
26
|
}
|
|
26
27
|
|
|
27
|
-
export const vue2Loader =
|
|
28
|
-
.pathname;
|
|
28
|
+
export const vue2Loader = fileURLToPath(import.meta.resolve(import.meta.url));
|
package/src/vue3-loader.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { fileURLToPath } from 'node:url';
|
|
1
2
|
import type { rspack } from '@esmx/rspack';
|
|
2
3
|
|
|
3
4
|
const ADD_IMPORT = `
|
|
@@ -20,5 +21,4 @@ export default function (this: rspack.LoaderContext, text: string) {
|
|
|
20
21
|
return text + ADD_IMPORT;
|
|
21
22
|
}
|
|
22
23
|
|
|
23
|
-
export const vue3Loader =
|
|
24
|
-
.pathname;
|
|
24
|
+
export const vue3Loader = fileURLToPath(import.meta.resolve(import.meta.url));
|