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?
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!
ES6 Module 导入方式仅对 js 文件有效。其他类型的文件,Webpack 通过 loader 插件处理后导入。
webpack loader