@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/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(args, config), pluginLess()],
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
- analyzerMode: "disabled",
77
- generateStatsFile: true,
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 build(rslibConfig, { watch: args.cmd === "build" && args.pack.watch });
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"));
@@ -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 ||
@@ -1,3 +0,0 @@
1
- {
2
- "recommendations": ["biomejs.biome"]
3
- }
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
- });
@@ -1,12 +0,0 @@
1
- <!doctype html>
2
- <html lang="zh-CN">
3
-
4
- <head>
5
- <meta charset="UTF-8">
6
- </head>
7
-
8
- <body>
9
- <div id="<%= mountId %>"></div>
10
- </body>
11
-
12
- </html>
package/tsconfig.json DELETED
@@ -1,11 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "allowImportingTsExtensions": true,
4
- "allowJs": true,
5
- "noEmit": true,
6
- "outDir": "./dist",
7
- "rootDir": "./"
8
- },
9
- "extends": "../../tsconfig.base.json",
10
- "include": ["./src/**/*", "./rslib.config.ts", "./types/*"]
11
- }