导入省略的svelte组件.svelte扩展名

是否有可能配置汇总来导入省略了.svelte扩展名的svelte组件?

从“路径/ MyComp”导入MyComp

MyComp文件的扩展名为.svelte

Mp3MIN 回答:导入省略的svelte组件.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
   ]
};
本文链接:https://www.f2er.com/3157798.html

大家都在问