@into-mini/sfc-split-plugin 0.5.1 → 0.5.3

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 CHANGED
@@ -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
- use: [
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/src/next.mts'),
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(newName)) {
71
- continue;
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.1",
3
+ "version": "0.5.3",
4
4
  "license": "MIT",
5
5
  "keywords": [
6
6
  "loader",
@@ -33,9 +33,9 @@
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/wxml-loader": "^0.0.0",
37
- "@into-mini/sfc-split-loader": "^0.2.0",
38
- "@into-mini/sfc-transformer": "^0.6.0"
36
+ "@into-mini/sfc-transformer": "^0.6.0",
37
+ "@into-mini/sfc-split-loader": "^0.2.2",
38
+ "@into-mini/wxml-loader": "^0.0.0"
39
39
  },
40
40
  "peerDependencies": {
41
41
  "webpack": "^5.104.0"