@best-shot/preset-mini 0.5.0 → 0.5.2

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/index.mjs +6 -16
  2. package/package.json +2 -2
package/index.mjs CHANGED
@@ -1,5 +1,3 @@
1
- import { fileURLToPath } from 'node:url';
2
-
3
1
  import { getAllPages, readYAML } from './helper.mjs';
4
2
 
5
3
  export function apply({
@@ -36,20 +34,9 @@ export function apply({
36
34
  .tap(([options]) => [{ exclude: /miniprogram_npm/, ...options }]);
37
35
  }
38
36
 
39
- chain.module
40
- .rule('wxml')
41
- .test(/\.wxml$/)
42
- .type('asset/resource')
43
- .use('wxml-parse-loader')
44
- .loader(
45
- fileURLToPath(
46
- import.meta.resolve(
47
- '@best-shot/sfc-split-plugin/wxml-parse-loader.cjs',
48
- ),
49
- ),
50
- );
37
+ chain.experiments.set('layers', true);
51
38
 
52
- chain.plugin('sfc-split').use('@best-shot/sfc-split-plugin/webpack.cjs');
39
+ chain.plugin('sfc-split').use('@best-shot/sfc-split-plugin');
53
40
 
54
41
  const context = chain.get('context');
55
42
 
@@ -60,7 +47,10 @@ export function apply({
60
47
  const allPages = getAllPages(io);
61
48
 
62
49
  for (const page of allPages) {
63
- chain.entry(page).add(`./${page}.vue`);
50
+ chain.entry(page).add({
51
+ import: `./${page}.vue`,
52
+ layer: page,
53
+ });
64
54
  }
65
55
  }
66
56
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@best-shot/preset-mini",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "description": "A `best-shot` preset for mini program project",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -29,7 +29,7 @@
29
29
  "type": "module",
30
30
  "dependencies": {
31
31
  "yaml": "^2.5.1",
32
- "@best-shot/sfc-split-plugin": "~0.7.0"
32
+ "@best-shot/sfc-split-plugin": "~0.7.2"
33
33
  },
34
34
  "peerDependencies": {
35
35
  "@best-shot/core": "~0.10.5",