是否有可能配置汇总以导入省略 .svelte
的 svelte 组件延期 ?
import MyComp from "path/MyComp"
MyComp 文件有 .svelte
延期
最佳答案
您可以使用 @rollup/plugin-node-resolve
在您的配置中添加解析器:
rollup.config.js
const resolve = require('@rollup/plugin-node-resolve'); // add this to the other requires
return {
... // the usual things like input, output, ...
plugins: [
resolve({
extensions: ['.svelte', '.js']
}),
svelte(),
... // any other plugin you are running
]
};
关于rollupjs - 导入 svelte 组件省略 .svelte 扩展名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58715992/