feng3d-cli 0.0.9 → 0.0.11
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "feng3d-cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.11",
|
|
4
4
|
"description": "feng3d 项目通用标准,包含代码规范、配置模板和 CLI 工具",
|
|
5
5
|
"homepage": "https://feng3d.com/feng3d-cli/",
|
|
6
6
|
"author": "feng",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"module": "./dist/index.js",
|
|
12
12
|
"exports": {
|
|
13
13
|
".": {
|
|
14
|
-
"types": "./
|
|
14
|
+
"types": "./lib/index.d.ts",
|
|
15
15
|
"import": "./dist/index.js",
|
|
16
16
|
"require": "./dist/index.umd.cjs"
|
|
17
17
|
}
|
|
@@ -6,13 +6,13 @@ const pkgpath = path.resolve('package.json');
|
|
|
6
6
|
let pkg = fs.readFileSync(pkgpath, 'utf8');
|
|
7
7
|
|
|
8
8
|
pkg = pkg
|
|
9
|
-
.
|
|
9
|
+
.replaceAll(`"types": "./lib/index.d.ts"`, `"types": "./src/index.ts"`)
|
|
10
10
|
//
|
|
11
|
-
.
|
|
12
|
-
.
|
|
11
|
+
.replaceAll(`"module": "./dist/index.js"`, `"module": "./src/index.ts"`)
|
|
12
|
+
.replaceAll(`"main": "./dist/index.umd.cjs"`, `"main": "./src/index.ts"`)
|
|
13
13
|
//
|
|
14
|
-
.
|
|
15
|
-
.
|
|
14
|
+
.replaceAll(`"import": "./dist/index.js"`, `"import": "./src/index.ts"`)
|
|
15
|
+
.replaceAll(`"require": "./dist/index.umd.cjs"`, `"require": "./src/index.ts"`)
|
|
16
16
|
;
|
|
17
17
|
|
|
18
18
|
fs.writeFileSync(pkgpath, pkg, 'utf8');
|
|
@@ -6,13 +6,13 @@ const pkgpath = path.resolve('package.json');
|
|
|
6
6
|
let pkg = fs.readFileSync(pkgpath, 'utf8');
|
|
7
7
|
|
|
8
8
|
pkg = pkg
|
|
9
|
-
.
|
|
9
|
+
.replaceAll(`"types": "./src/index.ts"`, `"types": "./lib/index.d.ts"`)
|
|
10
10
|
//
|
|
11
|
-
.
|
|
12
|
-
.
|
|
11
|
+
.replaceAll(`"module": "./src/index.ts"`, `"module": "./dist/index.js"`)
|
|
12
|
+
.replaceAll(`"main": "./src/index.ts"`, `"main": "./dist/index.umd.cjs"`)
|
|
13
13
|
//
|
|
14
|
-
.
|
|
15
|
-
.
|
|
14
|
+
.replaceAll(`"import": "./src/index.ts"`, `"import": "./dist/index.js"`)
|
|
15
|
+
.replaceAll(`"require": "./src/index.ts"`, `"require": "./dist/index.umd.cjs"`)
|
|
16
16
|
;
|
|
17
17
|
|
|
18
18
|
fs.writeFileSync(pkgpath, pkg, 'utf8');
|
package/templates/tsconfig.json
CHANGED
package/templates/vite.config.js
CHANGED
|
@@ -8,8 +8,10 @@ const namespace = 'feng3d';
|
|
|
8
8
|
const external = pkg.standalone ? [] : Object.keys(pkg.dependencies || []);
|
|
9
9
|
const globals = () => namespace;
|
|
10
10
|
|
|
11
|
+
// 构建时在输出文件底部添加版本号打印
|
|
12
|
+
const versionBanner = `console.log("${pkg.name} v${pkg.version}");`;
|
|
13
|
+
|
|
11
14
|
export default defineConfig({
|
|
12
|
-
publicDir: false,
|
|
13
15
|
build: {
|
|
14
16
|
lib: {
|
|
15
17
|
// Could also be a dictionary or array of multiple entry points
|
|
@@ -26,6 +28,8 @@ export default defineConfig({
|
|
|
26
28
|
output: {
|
|
27
29
|
// 在 UMD 构建模式下为这些外部化的依赖提供一个全局变量
|
|
28
30
|
globals,
|
|
31
|
+
// 在输出文件底部添加版本号打印
|
|
32
|
+
footer: versionBanner,
|
|
29
33
|
},
|
|
30
34
|
},
|
|
31
35
|
},
|