为了账号安全,请及时绑定邮箱和手机立即绑定

es6的import导入的问题

es6的import导入的问题

冉冉说 2018-11-08 14:15:22
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!

webpack loader


查看完整回答
反对 回复 2018-12-13
  • 1 回答
  • 0 关注
  • 740 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号