1 回答

TA貢獻(xiàn)2041條經(jīng)驗(yàn) 獲得超4個(gè)贊
ES6 Module 導(dǎo)入方式僅對(duì) js 文件有效。其他類(lèi)型的文件,Webpack 通過(guò) loader 插件處理后導(dǎo)入。
Loader: Loaders are transformations that are applied on the source code of a module. They allow you to preprocess files as you require() or “l(fā)oad” them. Thus, loaders are kind of like “tasks” in other build tools, and provide a powerful way to handle front-end build steps. Loaders can transform files from a different language (like TypeScript) to JavaScript, or inline images as data URLs. Loaders even allow you to do things like require() CSS files right in your JavaScript!
添加回答
舉報(bào)