@into-mini/sfc-split-plugin 0.5.11 → 0.5.12

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.d.mts CHANGED
@@ -1,9 +1,13 @@
1
1
  import type { Compiler, WebpackPluginInstance } from 'webpack';
2
2
  import type { Options } from '@into-mini/sfc-transformer/src/transformer.mts';
3
3
  export declare const COMPONENT_ROOT = "as-components";
4
+ type PluginOptions = Options & {
5
+ loaders?: boolean;
6
+ };
4
7
  export declare class SfcSplitPlugin implements WebpackPluginInstance {
5
8
  #private;
6
- options: Options;
7
- constructor({ type, tagMatcher, preserveTap }?: Options);
9
+ options: PluginOptions;
10
+ constructor({ type, tagMatcher, preserveTap, loaders, }?: PluginOptions);
8
11
  apply(compiler: Compiler): void;
9
12
  }
13
+ export {};
package/dist/index.mjs CHANGED
@@ -11,18 +11,16 @@ function reach(path) {
11
11
  const theLoader = reach('@into-mini/sfc-split-loader/dist/index.mjs');
12
12
  export class SfcSplitPlugin {
13
13
  options;
14
- constructor({ type = false, tagMatcher, preserveTap } = {}) {
14
+ constructor({ type = false, tagMatcher, preserveTap, loaders = true, } = {}) {
15
15
  this.options = {
16
16
  type,
17
17
  tagMatcher,
18
18
  preserveTap,
19
+ loaders,
19
20
  };
20
21
  }
21
22
  #applyLoader(compiler) {
22
23
  compiler.options.module.rules.push({
23
- test: /\.vue$/,
24
- use: [],
25
- }, {
26
24
  test: /\.vue$/,
27
25
  issuer: /\.vue$/,
28
26
  resourceQuery: /type=script/,
@@ -85,8 +83,10 @@ export class SfcSplitPlugin {
85
83
  });
86
84
  }
87
85
  apply(compiler) {
88
- this.#applyLoader(compiler);
89
- const { type } = this.options;
86
+ const { loaders, type } = this.options;
87
+ if (loaders) {
88
+ this.#applyLoader(compiler);
89
+ }
90
90
  if (type) {
91
91
  new AddWxsPlugin().apply(compiler);
92
92
  new MinaRuntimeWebpackPlugin().apply(compiler);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@into-mini/sfc-split-plugin",
3
- "version": "0.5.11",
3
+ "version": "0.5.12",
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/sfc-split-loader": "^0.2.6",
36
+ "@into-mini/sfc-transformer": "^0.6.2",
37
37
  "@into-mini/wxml-loader": "^0.0.0",
38
- "@into-mini/sfc-transformer": "^0.6.2"
38
+ "@into-mini/sfc-split-loader": "^0.2.6"
39
39
  },
40
40
  "peerDependencies": {
41
41
  "webpack": "^5.104.0"