javascript - es6 import import problem
迷茫
迷茫 2017-05-18 11:02:00
0
1
442

Isn’t the import of es6 importing something exposed by export or export default? Why can styl be imported directly through import when writing a stylus file in webpack?

迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

reply all(1)
迷茫

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template