是否有可能配置汇总来导入省略了.svelte扩展名的svelte组件?
从“路径/ MyComp”导入MyComp
MyComp文件的扩展名为.svelte
答案 0 :(得分:2)
您可以使用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
]
};