Closed aqkj closed 3 years ago
You can't overwrite the entire config.resolve
, otherwise some configs like resolve.extensions
will be lost, webpack will resolve @common/entitys/Layer.js
not ts
file. using config.resolve.alias['@common'] = path.resolve(__dirname, '../common')
or
configureWebpack: config => {
// return value will be merged
return {
resolve: {
alias: {
'@common': path.resolve(__dirname, './common')
}
}
}
}
Version
4.5.10
Environment info
Steps to reproduce
What is expected?
import { Layer } from '@common/entitys/Layer' // Resolve alias
What is actually happening?
I changed the code to this and it worked again: