Config alias chuẩn trong webpack (ok)
https://kipalog.com/posts/Config-alias-chuan-trong-webpack
Alias là gì?
// thay vì dùng
import Menu from '../../../components/Menu';
// thì dùng
import Menu from '@components/Menu';Thế nào là config chuẩn?
module.exports = {
//..
resolve: {
alias: {
'@components': path.resolve(__dirname, './src/components'),
}
}
}Cách thực hiện
Kết luận
PreviousWebpack từ A đến Á: Webpack resolve alias - extensionsNextWebpack từ A đến Á: Webpack Babel Loader (ok)
Last updated

