Comments (8)
两次运行之间我均手动删除了
dist
文件夹的。我借了一台 mac 笔记本进行了测试,两次打包结果是一样且正常的,无法复现你描述的情况:
![]()
在vscode下可以,
因为我是用的webstorm ,就生成有问题...
...em
这是vscode
这是webstorm
from vite-plugin-dts.
我调整了 replaceFilePath
方法内的正则表达式:
const replaceFilePath = path => {
return path.replace(/packages[\\/][a-zA-z]+([\\/])/, '$1')
}
分别在根目录下执行 node build.js
和 node scripts/build.js
,在 dist
下得到了一样的结果:
from vite-plugin-dts.
emm, 实在抱歉,因为我没有配置打包前删除原有的dist目录 。
所以需要手动删除dist之后,重新偿试打包,我这边还是没有达到预期的效果。
也许跟系统环境有关?(我的环境:macOS Big Sur 11.6.1 )
from vite-plugin-dts.
两次运行之间我均手动删除了 dist
文件夹的。
我借了一台 mac 笔记本进行了测试,两次打包结果是一样且正常的,无法复现你描述的情况:
from vite-plugin-dts.
补充,在windows下的webstorm中。执行build.js一样会只生成index.d.ts。其它的还是不见。
但是如果使用node script/build.js 是能正常的生成完全的.d.ts.
所以, 暂时不确定到底是ws的node换环境的问题还是插件的兼容问题。
因为在ws中运行 script/build.js是执行的"C:\Program Files\nodejs\node.exe" E:\myself\vue3-library\build.js (windows下)
from vite-plugin-dts.
最新,经调试发现,在webstorm中运行时,有路径对不上,所以没有生成
执行根目录下的build.js
执行非根目录下的build
向上寻找对应的地方创建project对象时
是否可能因为创建ts-morph的实例时outDir路径写死的原因?
from vite-plugin-dts.
可能在 webstorm 执行 scripts/build.js
时 cwd
被设置为 scripts
目录了,你可以尝试一下使用 root
选项将根目录显式地设置为项目根目录。
PS:如果是 cwd
被设置为 scripts
目录,我也不确定会不会影响到 typescript
的输出路径(ts-morpth
内部依然是使用 typescript
的方法的)
from vite-plugin-dts.
可能在 webstorm 执行
scripts/build.js
时cwd
被设置为scripts
目录了,你可以尝试一下使用root
选项将根目录显式地设置为项目根目录。PS:如果是
cwd
被设置为scripts
目录,我也不确定会不会影响到typescript
的输出路径(ts-morpth
内部依然是使用typescript
的方法的)
我也是这样想的,上面调试的时候已经显示的设置了root
的路径。因为之前没有显示设置的时候,获取组件路径就是错的。修证过后,才验证才出现上面的我说的情况。
这个问题,我先关闭了。不去深究了。因为打包时,究终会在package.json
里设置命令,使用 node script/build.js 去执行。
这样的结果反而是对的。 : (
from vite-plugin-dts.
Related Issues (20)
- `"type": "module"` with `rollupTypes: true` results in error HOT 1
- Feature: Support ${configDir} template variable in tsconfig.json (added in typescript 5.5)
- Error: "Cannot find module 'vue'" after updating to 3.8.0 or up HOT 1
- 大神,我生成的类型文件是源文件的结构,这种模式下导入组件的时候 package.json 中 types 该如何指定 HOT 1
- Issue while installing the plugin HOT 7
- Modify .tsx files during the build process to include additional TypeScript interfaces HOT 2
- namespace declaration exports two times HOT 3
- Can the index file under the file be searched by default And How to handle getResolvedModule errors HOT 1
- Volar generated type been added HOT 3
- Vue vulnerability HOT 4
- Declaration map d.ts.map files do not match transformed d.ts files HOT 1
- [vite:dts] Internal Error when re-exporting types from index.js HOT 6
- Upgrade @microsoft/[email protected] to latest so latest typescript version can be used HOT 2
- Adds many unrelated vue dependencies to the project HOT 1
- error during build: [vite:dts] Internal Error: Unable to determine module for: E:/develop/useBitable/dist/index.d.ts
- Bogus typescript errors related to default imports during since 4.x
- Missing Dependency "lru-cache@^6.0.0"
- Type error: File 'index.d.ts' is not a module since 4.0 HOT 1
- The new version (4.0.2) is unable to follow symbol for "Record" HOT 2
- Win11 - Internal Error with Vite and TypeScript - "Unable to follow symbol for 'Promise'" Description HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vite-plugin-dts.