是否有可能配置汇总以导入省略.svelte扩展名的svelte 组件?
import MyComp from "path/MyComp"
Run Code Online (Sandbox Code Playgroud)
MyComp 文件有.svelte扩展名
Ste*_*aes 16
您可以使用以下命令将解析器添加到您的配置中@rollup/plugin-node-resolve:
汇总配置文件
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
]
};
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
738 次 |
| 最近记录: |