@best-shot/preset-mini 0.11.17 → 0.11.19

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.
Files changed (2) hide show
  1. package/loader.mjs +30 -12
  2. package/package.json +7 -6
package/loader.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import extToRegexp from 'ext-to-regexp';
2
2
 
3
- export function applyLoaders(chain) {
3
+ export function applyLoaders(chain, options) {
4
4
  const babelRule = chain.module.rule('babel');
5
5
 
6
6
  const vueRegexp = extToRegexp({ extname: ['vue'] });
@@ -25,7 +25,7 @@ export function applyLoaders(chain) {
25
25
  .issuer(vueRegexp)
26
26
  .resourceQuery(/type=template/)
27
27
  .type('asset/resource')
28
- .generator.filename('[entry].wxml')
28
+ .generator.filename('[entry][hash:8].wxml')
29
29
  .end()
30
30
  .use('wxml-loader')
31
31
  .loader('@into-mini/wxml-loader')
@@ -34,16 +34,36 @@ export function applyLoaders(chain) {
34
34
  .loader('@into-mini/sfc-split-loader/dist/index.mjs');
35
35
 
36
36
  vueRule
37
- .rule('extract-vue-config')
37
+ .rule('extract-vue-config-json')
38
38
  .test(vueRegexp)
39
39
  .issuer(vueRegexp)
40
40
  .resourceQuery(/type=config&lang=json/)
41
41
  .type('asset/resource')
42
- .generator.filename('[entry].json')
42
+ .generator.filename('[entry][hash:8].json')
43
43
  .end()
44
44
  .use('entry-loader')
45
45
  .loader('@into-mini/sfc-split-plugin/dist/loader/entry-loader.mjs')
46
46
  .end()
47
+ .use('yaml-loader')
48
+ .loader('yaml-patch-loader')
49
+ .end()
50
+ .use('sfc-split-loader')
51
+ .loader('@into-mini/sfc-split-loader/dist/index.mjs');
52
+
53
+ vueRule
54
+ .rule('extract-vue-config-yaml')
55
+ .test(vueRegexp)
56
+ .issuer(vueRegexp)
57
+ .resourceQuery(/type=config&lang=yaml/)
58
+ .type('asset/resource')
59
+ .generator.filename('[entry][hash:8].json')
60
+ .end()
61
+ .use('entry-loader')
62
+ .loader('@into-mini/sfc-split-plugin/dist/loader/entry-loader.mjs')
63
+ .end()
64
+ .use('yaml-loader')
65
+ .loader('yaml-patch-loader')
66
+ .end()
47
67
  .use('sfc-split-loader')
48
68
  .loader('@into-mini/sfc-split-loader/dist/index.mjs');
49
69
 
@@ -76,17 +96,15 @@ export function applyLoaders(chain) {
76
96
 
77
97
  vueRule
78
98
  .rule('split-vue')
79
- .issuer({ not: vueRegexp })
80
99
  .resourceQuery({ not: /type=/ })
81
100
  .type('javascript/esm')
82
101
  .use('sfc-split-loader')
83
102
  .loader('@into-mini/sfc-split-loader/dist/index.mjs');
84
103
 
85
- // vueRule
86
- // .rule('pre-vue').issuer({ not: vueRegexp })
87
- // .resourceQuery({ not: /type=/ })
88
- // .use('sfc-split-loader')
89
- // .use('sfc-split-pre')
90
- // .loader('@into-mini/sfc-split-loader/dist/next.mjs')
91
- // .options(options)
104
+ vueRule
105
+ .rule('pre-vue')
106
+ .resourceQuery({ not: /type=/ })
107
+ .use('sfc-split-pre')
108
+ .loader('@into-mini/sfc-split-loader/dist/next.mjs')
109
+ .options(options);
92
110
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@best-shot/preset-mini",
3
- "version": "0.11.17",
3
+ "version": "0.11.19",
4
4
  "description": "A `best-shot` preset for mini program project",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -27,18 +27,19 @@
27
27
  "main": "index.mjs",
28
28
  "type": "module",
29
29
  "dependencies": {
30
- "@into-mini/auto-entries-plugin": "^0.2.0",
30
+ "@into-mini/auto-entries-plugin": "^0.2.1",
31
31
  "@into-mini/sfc-split-loader": "^0.2.6",
32
- "@into-mini/sfc-split-plugin": "^0.6.0",
32
+ "@into-mini/sfc-split-plugin": "^0.6.1",
33
33
  "@into-mini/wxml-loader": "^0.0.0",
34
34
  "ext-to-regexp": "^0.1.0",
35
- "yaml": "^2.8.2"
35
+ "yaml": "^2.8.2",
36
+ "yaml-patch-loader": "^0.1.0"
36
37
  },
37
38
  "peerDependencies": {
38
39
  "@babel/core": "^7.28.5",
39
- "@best-shot/core": "^0.13.10",
40
40
  "@best-shot/preset-babel": "^0.18.6",
41
- "@best-shot/preset-style": "^0.16.3"
41
+ "@best-shot/preset-style": "^0.16.3",
42
+ "@best-shot/core": "^0.13.10"
42
43
  },
43
44
  "engines": {
44
45
  "node": ">=22.11.0"