@into-mini/sfc-split-plugin 0.5.10 → 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 +6 -2
- package/dist/index.mjs +11 -11
- package/package.json +2 -2
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:
|
|
7
|
-
constructor({ type, tagMatcher, preserveTap }?:
|
|
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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { fileURLToPath } from 'node:url';
|
|
2
2
|
import { AddWxsPlugin } from "./plugin/add-wxs.mjs";
|
|
3
3
|
import { ExposeEntryNamePlugin } from "./plugin/expose-entry.mjs";
|
|
4
|
-
import { EntryRenamePlugin } from
|
|
4
|
+
// import { EntryRenamePlugin } from './plugin/entry-rename.mts';
|
|
5
5
|
import { MinaRuntimeWebpackPlugin } from "./plugin/mina-runtime.mjs";
|
|
6
6
|
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
|
|
7
7
|
export const COMPONENT_ROOT = 'as-components';
|
|
@@ -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,16 +83,18 @@ export class SfcSplitPlugin {
|
|
|
85
83
|
});
|
|
86
84
|
}
|
|
87
85
|
apply(compiler) {
|
|
88
|
-
this
|
|
89
|
-
|
|
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);
|
|
93
93
|
new ExposeEntryNamePlugin().apply(compiler);
|
|
94
|
-
new EntryRenamePlugin({
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}).apply(compiler);
|
|
94
|
+
// new EntryRenamePlugin({
|
|
95
|
+
// issuer: /\.vue$/,
|
|
96
|
+
// test: /\.wxml|json/,
|
|
97
|
+
// }).apply(compiler);
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
100
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@into-mini/sfc-split-plugin",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.12",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"loader",
|
|
@@ -33,7 +33,7 @@
|
|
|
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-transformer": "^0.6.
|
|
36
|
+
"@into-mini/sfc-transformer": "^0.6.2",
|
|
37
37
|
"@into-mini/wxml-loader": "^0.0.0",
|
|
38
38
|
"@into-mini/sfc-split-loader": "^0.2.6"
|
|
39
39
|
},
|