@into-mini/sfc-split-plugin 0.5.4 → 0.5.6
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 +9 -0
- package/dist/loader/fake-vue-loader.d.mts +2 -0
- package/dist/plugin/add-wxs.d.mts +10 -0
- package/dist/plugin/add-wxs.mjs +1 -1
- package/dist/plugin/entry-rename.d.mts +15 -0
- package/dist/plugin/expose-entry-bk.d.mts +6 -0
- package/dist/plugin/expose-entry.d.mts +7 -0
- package/dist/plugin/mina-runtime.d.mts +5 -0
- package/dist/plugin/sfc-split.d.mts +18 -0
- package/package.json +3 -3
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Options } from './plugin/sfc-split.mts';
|
|
2
|
+
import type { Compiler, WebpackPluginInstance } from 'webpack';
|
|
3
|
+
export declare const COMPONENT_ROOT = "as-components";
|
|
4
|
+
export declare class SfcSplitPlugin implements WebpackPluginInstance {
|
|
5
|
+
#private;
|
|
6
|
+
options: Options;
|
|
7
|
+
constructor({ type, tagMatcher, preserveTap }?: Options);
|
|
8
|
+
apply(compiler: Compiler): void;
|
|
9
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Compiler, WebpackPluginInstance } from 'webpack';
|
|
2
|
+
/**
|
|
3
|
+
* 将clsx.wxs文件添加到编译结果中,并替换WXML文件中的占位符。
|
|
4
|
+
* 只在发现CLSX_PLACEHOLDER时添加wxs文件,且只添加一次。
|
|
5
|
+
*/
|
|
6
|
+
export declare class AddWxsPlugin implements WebpackPluginInstance {
|
|
7
|
+
#private;
|
|
8
|
+
PLUGIN_NAME: string;
|
|
9
|
+
apply(compiler: Compiler): void;
|
|
10
|
+
}
|
package/dist/plugin/add-wxs.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { readFileSync } from 'node:fs';
|
|
2
2
|
import { extname, join, relative } from 'node:path';
|
|
3
3
|
import { fileURLToPath } from 'node:url';
|
|
4
|
-
import { CLSX_PLACEHOLDER } from '@into-mini/sfc-transformer/
|
|
4
|
+
import { CLSX_PLACEHOLDER } from '@into-mini/sfc-transformer/dist/utils.mjs';
|
|
5
5
|
import slash from 'slash';
|
|
6
6
|
// WXS文件输出路径
|
|
7
7
|
const WXS_FILENAME = 'wxs/clsx.wxs';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Compiler, WebpackPluginInstance } from 'webpack';
|
|
2
|
+
type Matcher = RegExp | string | ((value: string) => boolean);
|
|
3
|
+
export interface EntryAssetNamePluginOptions {
|
|
4
|
+
issuer?: Matcher;
|
|
5
|
+
test?: Matcher;
|
|
6
|
+
}
|
|
7
|
+
export declare class EntryRenamePlugin implements WebpackPluginInstance {
|
|
8
|
+
private options;
|
|
9
|
+
constructor(options?: EntryAssetNamePluginOptions);
|
|
10
|
+
private getIssuerPath;
|
|
11
|
+
private matchIssuer;
|
|
12
|
+
private matchTest;
|
|
13
|
+
apply(compiler: Compiler): void;
|
|
14
|
+
}
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Compiler, Compilation, PathData, Module, WebpackPluginInstance } from 'webpack';
|
|
2
|
+
export declare class ExposeEntryNamePlugin implements WebpackPluginInstance {
|
|
3
|
+
getEntryNameFromEntries(compilation: Compilation, module: Module): string;
|
|
4
|
+
getEntryNameFromPathData(compilation: Compilation, pathData: PathData): string;
|
|
5
|
+
apply(compiler: Compiler): void;
|
|
6
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Compiler, Compilation, PathData, Module, Chunk, WebpackPluginInstance } from 'webpack';
|
|
2
|
+
export declare class ExposeEntryNamePlugin implements WebpackPluginInstance {
|
|
3
|
+
getEntryNameFromChunk(chunk: Chunk): string | null | undefined;
|
|
4
|
+
getEntryNameFromEntries(compilation: Compilation, module: Module): string;
|
|
5
|
+
getEntryNameFromPathData(pathData: PathData): string;
|
|
6
|
+
apply(compiler: Compiler): void;
|
|
7
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import VirtualModulesPlugin from 'webpack-virtual-modules';
|
|
2
|
+
import type { Compiler, WebpackPluginInstance } from 'webpack';
|
|
3
|
+
export type Options = {
|
|
4
|
+
type?: boolean;
|
|
5
|
+
tagMatcher?: (tag: string) => {
|
|
6
|
+
tag: string;
|
|
7
|
+
path: string;
|
|
8
|
+
};
|
|
9
|
+
preserveTap?: (tag: string) => boolean;
|
|
10
|
+
};
|
|
11
|
+
export declare class SfcSplitPluginBase extends VirtualModulesPlugin implements WebpackPluginInstance {
|
|
12
|
+
#private;
|
|
13
|
+
PLUGIN_NAME: string;
|
|
14
|
+
tagMatcher: Options['tagMatcher'];
|
|
15
|
+
preserveTap: Options['preserveTap'];
|
|
16
|
+
constructor({ tagMatcher, preserveTap }: Options);
|
|
17
|
+
apply(compiler: Compiler): void;
|
|
18
|
+
}
|
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.6",
|
|
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.
|
|
36
|
+
"@into-mini/sfc-split-loader": "^0.2.5",
|
|
37
37
|
"@into-mini/wxml-loader": "^0.0.0",
|
|
38
|
-
"@into-mini/sfc-transformer": "^0.6.
|
|
38
|
+
"@into-mini/sfc-transformer": "^0.6.1"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"webpack": "^5.104.0"
|