tdesign-starter-cli 版本
0.3.3
重现链接
无需链接即可重现
重现步骤
执行命令
按步骤生成lite模板
? 请输入项目名称: test2
? 请输入项目描述: Base on tdesign-starter-cli
? 选择模板类型: (Use arrow keys)
❯ 【Vue2】模板
? 生成代码版本: (Use arrow keys)
❯ Lite版本 (只包含TDesign的基本使用和项目工程)
? 请选择构建工具 (Use arrow keys)
❯ vite
生成模板成功
👉 开始构建,请稍侯...
⠋ 正在构建模板...👉 生成代码完毕...
✔ 构建成功!
👏 初始化项目完成!👏
打开模板地址,没有.gitignore
文件
cd test2 && ls -a
# . README.md index.html public vite.config.js
# .. assets package.json src
期望结果
生成的lite模板含有.gitignore
文件
实际结果
模板没有.gitignore
文件。.gitignore文件非常重要,没有此文件可能导致不注意时上传了node_modules或者其他文件。
框架版本
No response
浏览器版本
No response
系统版本
No response
Node版本
16.20.0
补充说明
根据npm官网文档,.gitignore
文件会被忽略发布,需要特殊配置
原文信息:
Files included in package
To see what will be included in your package, run npm pack --dry-run. All files are included by default, with the following exceptions:
Certain files that are relevant to package installation and distribution are always included. For example, package.json, README.md, LICENSE, and so on.
If there is a "files" list in package.json, then only the files specified will be included. (If directories are specified, then they will be walked recursively and their contents included, subject to the same ignore rules.)
If there is a .gitignore or .npmignore file, then ignored files in that and all child directories will be excluded from the package. If both files exist, then the .gitignore is ignored, and only the .npmignore is used.
.npmignore files follow the same pattern rules as .gitignore files
If the file matches certain patterns, then it will never be included, unless explicitly added to the "files" list in package.json, or un-ignored with a ! rule in a .npmignore or .gitignore file.
Symbolic links are never included in npm packages.
See developers for full details on what's included in the published package, as well as details on how the package is built.