Loaders:
- transform the import
- loaders is a list and processing is from RIGHT to LEFT.
- file loader does not work wit svg-sprite-loader.
but default storybook has it so we need to exclude it
- loader accept a string
What is file loader?
The file-loader resolves import/require() on a file into a url and emits the file into the output directory.
> after file loader, the content of file is converted to
"module.exports = __webpack_public_path__ + "static/media/dollar.613ee179.svg";"
file-loader
https://github.com/webpack-contrib/file-loader
Emit the file with good hash name
Output file is configure by webpack configure
output: { path:}
Replace url(xxx) by publicPath/hash
pubic path is configure in webpage.output.publicPath
Tricks:
- loader are not minimized, change the loader code directly to log info