@best-shot/preset-mini 0.11.18 → 0.11.20
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/loader.mjs +15 -33
- package/package.json +4 -4
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'] });
|
|
@@ -17,7 +17,8 @@ export function applyLoaders(chain) {
|
|
|
17
17
|
.merge(babelRule.use('babel-loader').entries())
|
|
18
18
|
.end()
|
|
19
19
|
.use('sfc-split-loader')
|
|
20
|
-
.loader('@into-mini/sfc-split-loader/dist/index.mjs')
|
|
20
|
+
.loader('@into-mini/sfc-split-loader/dist/index.mjs')
|
|
21
|
+
.options(options);
|
|
21
22
|
|
|
22
23
|
vueRule
|
|
23
24
|
.rule('extract-vue-template')
|
|
@@ -25,35 +26,22 @@ export function applyLoaders(chain) {
|
|
|
25
26
|
.issuer(vueRegexp)
|
|
26
27
|
.resourceQuery(/type=template/)
|
|
27
28
|
.type('asset/resource')
|
|
28
|
-
.generator.filename('[entry].wxml')
|
|
29
|
+
.generator.filename('[entry][hash:8].wxml')
|
|
29
30
|
.end()
|
|
30
31
|
.use('wxml-loader')
|
|
31
32
|
.loader('@into-mini/wxml-loader')
|
|
32
33
|
.end()
|
|
33
34
|
.use('sfc-split-loader')
|
|
34
|
-
.loader('@into-mini/sfc-split-loader/dist/index.mjs')
|
|
35
|
+
.loader('@into-mini/sfc-split-loader/dist/index.mjs')
|
|
36
|
+
.options(options);
|
|
35
37
|
|
|
36
38
|
vueRule
|
|
37
|
-
.rule('extract-vue-config
|
|
39
|
+
.rule('extract-vue-config')
|
|
38
40
|
.test(vueRegexp)
|
|
39
41
|
.issuer(vueRegexp)
|
|
40
|
-
.resourceQuery(/type=config&lang=json/)
|
|
42
|
+
.resourceQuery(/type=config&lang=(yaml|json)/)
|
|
41
43
|
.type('asset/resource')
|
|
42
|
-
.generator.filename('[entry].json')
|
|
43
|
-
.end()
|
|
44
|
-
.use('entry-loader')
|
|
45
|
-
.loader('@into-mini/sfc-split-plugin/dist/loader/entry-loader.mjs')
|
|
46
|
-
.end()
|
|
47
|
-
.use('sfc-split-loader')
|
|
48
|
-
.loader('@into-mini/sfc-split-loader/dist/index.mjs');
|
|
49
|
-
|
|
50
|
-
vueRule
|
|
51
|
-
.rule('extract-vue-config-yaml')
|
|
52
|
-
.test(vueRegexp)
|
|
53
|
-
.issuer(vueRegexp)
|
|
54
|
-
.resourceQuery(/type=config&lang=yaml/)
|
|
55
|
-
.type('asset/resource')
|
|
56
|
-
.generator.filename('[entry].json')
|
|
44
|
+
.generator.filename('[entry][hash:8].json')
|
|
57
45
|
.end()
|
|
58
46
|
.use('entry-loader')
|
|
59
47
|
.loader('@into-mini/sfc-split-plugin/dist/loader/entry-loader.mjs')
|
|
@@ -62,7 +50,8 @@ export function applyLoaders(chain) {
|
|
|
62
50
|
.loader('yaml-patch-loader')
|
|
63
51
|
.end()
|
|
64
52
|
.use('sfc-split-loader')
|
|
65
|
-
.loader('@into-mini/sfc-split-loader/dist/index.mjs')
|
|
53
|
+
.loader('@into-mini/sfc-split-loader/dist/index.mjs')
|
|
54
|
+
.options(options);
|
|
66
55
|
|
|
67
56
|
const xRule = vueRule
|
|
68
57
|
.rule('extract-vue-style')
|
|
@@ -89,21 +78,14 @@ export function applyLoaders(chain) {
|
|
|
89
78
|
xRule
|
|
90
79
|
.rule('extract')
|
|
91
80
|
.use('sfc-split-loader')
|
|
92
|
-
.loader('@into-mini/sfc-split-loader/dist/index.mjs')
|
|
81
|
+
.loader('@into-mini/sfc-split-loader/dist/index.mjs')
|
|
82
|
+
.options(options);
|
|
93
83
|
|
|
94
84
|
vueRule
|
|
95
85
|
.rule('split-vue')
|
|
96
|
-
.issuer({ not: vueRegexp })
|
|
97
86
|
.resourceQuery({ not: /type=/ })
|
|
98
87
|
.type('javascript/esm')
|
|
99
88
|
.use('sfc-split-loader')
|
|
100
|
-
.loader('@into-mini/sfc-split-loader/dist/index.mjs')
|
|
101
|
-
|
|
102
|
-
// vueRule
|
|
103
|
-
// .rule('pre-vue').issuer({ not: vueRegexp })
|
|
104
|
-
// .resourceQuery({ not: /type=/ })
|
|
105
|
-
// .use('sfc-split-loader')
|
|
106
|
-
// .use('sfc-split-pre')
|
|
107
|
-
// .loader('@into-mini/sfc-split-loader/dist/next.mjs')
|
|
108
|
-
// .options(options)
|
|
89
|
+
.loader('@into-mini/sfc-split-loader/dist/index.mjs')
|
|
90
|
+
.options(options);
|
|
109
91
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@best-shot/preset-mini",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.20",
|
|
4
4
|
"description": "A `best-shot` preset for mini program project",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"dependencies": {
|
|
30
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.
|
|
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
35
|
"yaml": "^2.8.2",
|
|
@@ -37,9 +37,9 @@
|
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"@babel/core": "^7.28.5",
|
|
40
|
+
"@best-shot/preset-style": "^0.16.3",
|
|
40
41
|
"@best-shot/core": "^0.13.10",
|
|
41
|
-
"@best-shot/preset-babel": "^0.18.6"
|
|
42
|
-
"@best-shot/preset-style": "^0.16.3"
|
|
42
|
+
"@best-shot/preset-babel": "^0.18.6"
|
|
43
43
|
},
|
|
44
44
|
"engines": {
|
|
45
45
|
"node": ">=22.11.0"
|