-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
preserveModulesRoot
is invalid in windows
#54
Comments
默认的输出路径和 vite 打包输出路径一样,你可以通过插件选项 |
@qmhc 似乎是应为插件不支持应为这个参数导致的 |
看代码中并没有对 Lines 319 to 340 in 173dfe7
我用下面这种方式修改了路径 plugins: [dtsPlugin({
cleanVueFileName: true,
beforeWriteFile(filePath, content){
return {
filePath: filePath.replace(`${rootPath}/es/src`, `${rootPath}/es`),
content,
};
}
}), vue()] |
我是想打包的定义文件和生成的js文件平级 比如说这里有两个原始文件
现在打包后是,其中的
我想要的结果是
我现在是通过 |
目录不一致的原因是因为没有处理vite配置文件 //vite.config.js
{
...
build: {
rollupOptions: {
output: {
entryFileNames: '[name].js',
preserveModules: true,
preserveModulesRoot,
},
}
}
...
} 其中 |
这个也不正确,es目录下统一多了一个下src目录 |
这个和在我的机器上(mac)的打包结果不同,看结果似乎是因为在Windows上的 |
插件生成出来的类型文件始终带着src目录,这是问题所在 |
这个似乎是vite的问题,我在那边提了个issue |
@qmhc 可以指定生成路径吗? 我也遇到这个问题,我是调用 vite 的build方法进行打包的,而dts总是自动生成跟开发环境一样的目录,e.g.
|
preserveModulesRoot
is invalid in windows
相关问题仍在等待 vite 分流,插件层面存在暂时解决方案,我先修改标题并关闭这个 issue 以免产生误导。 @agileago 如果你的问题仍未解决,你可以打开一个新的 issue,并提供具体的配置和环境信息,如果可以提供一个最小的复现项目,将更有助于更快地定位问题。 |
https://github.com/ckpack/v-ui
The text was updated successfully, but these errors were encountered: