@into-mini/sfc-split-plugin 0.5.1 → 0.5.4
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/index.mjs +10 -13
- package/dist/plugin/entry-rename.mjs +2 -3
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -7,7 +7,7 @@ export const COMPONENT_ROOT = 'as-components';
|
|
|
7
7
|
function reach(path) {
|
|
8
8
|
return fileURLToPath(import.meta.resolve(path));
|
|
9
9
|
}
|
|
10
|
-
const theLoader = reach('@into-mini/sfc-split-loader/
|
|
10
|
+
const theLoader = reach('@into-mini/sfc-split-loader/dist/index.mjs');
|
|
11
11
|
export class SfcSplitPlugin {
|
|
12
12
|
options;
|
|
13
13
|
constructor({ type = false, tagMatcher, preserveTap } = {}) {
|
|
@@ -42,7 +42,7 @@ export class SfcSplitPlugin {
|
|
|
42
42
|
resourceQuery: /type=template/,
|
|
43
43
|
type: 'asset/resource',
|
|
44
44
|
generator: {
|
|
45
|
-
filename: '[hash:8].wxml',
|
|
45
|
+
filename: '[path][name].[hash:8].wxml',
|
|
46
46
|
},
|
|
47
47
|
use: [
|
|
48
48
|
{
|
|
@@ -64,7 +64,7 @@ export class SfcSplitPlugin {
|
|
|
64
64
|
}, {
|
|
65
65
|
test: /\.vue$/,
|
|
66
66
|
issuer: /\.vue$/,
|
|
67
|
-
resourceQuery: [/type=config/],
|
|
67
|
+
resourceQuery: [/type=config&lang=json/],
|
|
68
68
|
type: 'asset/resource',
|
|
69
69
|
generator: {
|
|
70
70
|
filename: '[path][hash:8].json',
|
|
@@ -73,16 +73,13 @@ export class SfcSplitPlugin {
|
|
|
73
73
|
}, {
|
|
74
74
|
test: /\.vue$/,
|
|
75
75
|
resourceQuery: { not: /type=/ },
|
|
76
|
+
type: 'javascript/esm',
|
|
77
|
+
loader: theLoader,
|
|
78
|
+
}, {
|
|
79
|
+
test: /\.vue$/,
|
|
76
80
|
enforce: 'pre',
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
loader: theLoader,
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
loader: reach('@into-mini/sfc-split-loader/src/next.mts'),
|
|
83
|
-
options: this.options,
|
|
84
|
-
},
|
|
85
|
-
],
|
|
81
|
+
loader: reach('@into-mini/sfc-split-loader/dist/next.mjs'),
|
|
82
|
+
options: this.options,
|
|
86
83
|
});
|
|
87
84
|
}
|
|
88
85
|
apply(compiler) {
|
|
@@ -95,7 +92,7 @@ export class SfcSplitPlugin {
|
|
|
95
92
|
// new ExposeEntryNamePlugin().apply(compiler);
|
|
96
93
|
new EntryRenamePlugin({
|
|
97
94
|
issuer: /\.vue$/,
|
|
98
|
-
test: /\.wxml/,
|
|
95
|
+
test: /\.wxml|json/,
|
|
99
96
|
}).apply(compiler);
|
|
100
97
|
}
|
|
101
98
|
}
|
|
@@ -67,10 +67,9 @@ export class EntryRenamePlugin {
|
|
|
67
67
|
if (newName === filename) {
|
|
68
68
|
continue;
|
|
69
69
|
}
|
|
70
|
-
if (compilation.getAsset(
|
|
71
|
-
|
|
70
|
+
if (compilation.getAsset(filename)) {
|
|
71
|
+
compilation.renameAsset(filename, newName);
|
|
72
72
|
}
|
|
73
|
-
compilation.renameAsset(filename, newName);
|
|
74
73
|
}
|
|
75
74
|
});
|
|
76
75
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@into-mini/sfc-split-plugin",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"loader",
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"webpack-virtual-modules": "^0.6.2",
|
|
34
34
|
"yaml": "^2.8.2",
|
|
35
35
|
"@into-mini/clsx": "^0.1.0",
|
|
36
|
+
"@into-mini/sfc-split-loader": "^0.2.2",
|
|
36
37
|
"@into-mini/wxml-loader": "^0.0.0",
|
|
37
|
-
"@into-mini/sfc-split-loader": "^0.2.0",
|
|
38
38
|
"@into-mini/sfc-transformer": "^0.6.0"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|