es6的import导入的不是export或者export default暴露出来的东西吗,为什么在webpack中写stylus文件styl也可以直接通过import导入?
1 回答

缥缈止盈
TA贡献2041条经验 获得超4个赞
ES6 Module 导入方式仅对 js 文件有效。其他类型的文件,Webpack 通过 loader 插件处理后导入。
Loader: Loaders are transformations that are applied on the source code of a module. They allow you to preprocess files as you require() or “load” 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!
添加回答
举报
0/150
提交
取消