@yannick-z/modulo 0.3.0 → 0.3.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.
- package/bin/modulo.js +1 -1
- package/dist/183.js +130 -0
- package/dist/740.js +793 -0
- package/dist/882.js +697 -0
- package/dist/bin/modulo.js +93 -0
- package/dist/index.js +200 -0
- package/package.json +14 -6
- package/src/bin/modulo.ts +16 -0
- package/src/config/presets.ts +1 -1
- package/src/index.ts +3 -1
- package/src/packer/auto-external-plugin.ts +153 -59
- package/src/packer/get-externals-and-tags.ts +18 -11
- package/src/packer/lib.ts +9 -6
- package/src/packer/page.ts +2 -3
- package/.vscode/extensions.json +0 -3
- package/biome.json +0 -34
- package/rslib.config.ts +0 -22
- package/template/index.html +0 -12
- package/tsconfig.json +0 -11
package/src/packer/lib.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { pluginLess } from "@rsbuild/plugin-less";
|
|
2
|
-
import { build, defineConfig } from "@rslib/core";
|
|
2
|
+
import { build as rslibBuild, defineConfig } from "@rslib/core";
|
|
3
3
|
import picocolors from "picocolors";
|
|
4
4
|
import type { ModuloArgs_Pack } from "../args/index.ts";
|
|
5
5
|
import { get_global_config, get_packagejson } from "../config/index.ts";
|
|
@@ -28,7 +28,7 @@ export async function lib_pack(args: ModuloArgs_Pack) {
|
|
|
28
28
|
define: config.define,
|
|
29
29
|
entry: entries,
|
|
30
30
|
},
|
|
31
|
-
plugins: [framework_plugin(
|
|
31
|
+
plugins: [framework_plugin(config), pluginLess()],
|
|
32
32
|
resolve: {
|
|
33
33
|
alias: config.alias,
|
|
34
34
|
},
|
|
@@ -73,9 +73,9 @@ export async function lib_pack(args: ModuloArgs_Pack) {
|
|
|
73
73
|
performance: {
|
|
74
74
|
bundleAnalyze: config.analyze
|
|
75
75
|
? {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
analyzerMode: "disabled",
|
|
77
|
+
generateStatsFile: true,
|
|
78
|
+
}
|
|
79
79
|
: undefined,
|
|
80
80
|
chunkSplit: {
|
|
81
81
|
strategy: "all-in-one",
|
|
@@ -83,7 +83,10 @@ export async function lib_pack(args: ModuloArgs_Pack) {
|
|
|
83
83
|
},
|
|
84
84
|
});
|
|
85
85
|
|
|
86
|
-
await
|
|
86
|
+
await rslibBuild(rslibConfig, {
|
|
87
|
+
watch: args.cmd === "build" && !!args.pack.watch,
|
|
88
|
+
root: process.cwd(),
|
|
89
|
+
});
|
|
87
90
|
|
|
88
91
|
if (args.cmd === "build") {
|
|
89
92
|
console.log(picocolors.green("\n**** 构建【module】完成 ****\n"));
|
package/src/packer/page.ts
CHANGED
|
@@ -39,14 +39,13 @@ export async function page_pack(args: ModuloArgs_Pack) {
|
|
|
39
39
|
tools: {
|
|
40
40
|
rspack: {
|
|
41
41
|
experiments: {
|
|
42
|
-
outputModule: true,
|
|
42
|
+
outputModule: config.externalsType === "importmap" ? true : undefined,
|
|
43
43
|
},
|
|
44
44
|
plugins: [
|
|
45
45
|
// @ts-ignore Rspack 插件类型兼容问题
|
|
46
46
|
new AutoExternalPlugin(args, config),
|
|
47
47
|
],
|
|
48
48
|
},
|
|
49
|
-
htmlPlugin: true,
|
|
50
49
|
},
|
|
51
50
|
output: {
|
|
52
51
|
assetPrefix: config.url.cdn || config.url.base,
|
|
@@ -61,7 +60,7 @@ export async function page_pack(args: ModuloArgs_Pack) {
|
|
|
61
60
|
html: {
|
|
62
61
|
meta: config.html.meta,
|
|
63
62
|
mountId: config.html.root,
|
|
64
|
-
scriptLoading: "module",
|
|
63
|
+
scriptLoading: config.externalsType === "importmap" ? undefined : "module",
|
|
65
64
|
tags: config.html.tags,
|
|
66
65
|
template:
|
|
67
66
|
config.html.template ||
|
package/.vscode/extensions.json
DELETED
package/biome.json
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://biomejs.dev/schemas/2.4.4/schema.json",
|
|
3
|
-
"vcs": {
|
|
4
|
-
"enabled": false,
|
|
5
|
-
"clientKind": "git",
|
|
6
|
-
"useIgnoreFile": false
|
|
7
|
-
},
|
|
8
|
-
"files": {
|
|
9
|
-
"ignoreUnknown": false
|
|
10
|
-
},
|
|
11
|
-
"formatter": {
|
|
12
|
-
"enabled": true,
|
|
13
|
-
"indentStyle": "tab"
|
|
14
|
-
},
|
|
15
|
-
"linter": {
|
|
16
|
-
"enabled": true,
|
|
17
|
-
"rules": {
|
|
18
|
-
"recommended": true
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
"javascript": {
|
|
22
|
-
"formatter": {
|
|
23
|
-
"quoteStyle": "double"
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
"assist": {
|
|
27
|
-
"enabled": true,
|
|
28
|
-
"actions": {
|
|
29
|
-
"source": {
|
|
30
|
-
"organizeImports": "on"
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
package/rslib.config.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from "@rslib/core";
|
|
2
|
-
|
|
3
|
-
export default defineConfig({
|
|
4
|
-
lib: [
|
|
5
|
-
{
|
|
6
|
-
dts: false,
|
|
7
|
-
format: "esm",
|
|
8
|
-
syntax: "esnext",
|
|
9
|
-
},
|
|
10
|
-
],
|
|
11
|
-
output: {
|
|
12
|
-
distPath: {
|
|
13
|
-
root: "./dist",
|
|
14
|
-
},
|
|
15
|
-
target: "node",
|
|
16
|
-
},
|
|
17
|
-
source: {
|
|
18
|
-
entry: {
|
|
19
|
-
index: "./src/index.ts",
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
});
|
package/template/index.html
DELETED
package/tsconfig.json
DELETED