If you don't write the relative path to the last layer in webpack, you will make an error. If you can't find this file, how to find it automatically?

clipboard.png
if you don"t write the relative path to the last layer in webpack, there will be an error. If you can"t find this file, how to find it automatically? Something like "@ api" will automatically find".. /.. / api"," @ qa" will automatically find".. /.. / qa".. You don"t have to configure each one, but gradually go to the upper level to find it. I"ve heard of this kind of dependence, and I forgot what it is

Mar.23,2021

configure resolve.alias in your webpack configuration file.

// webpack.config.js

resolve: {
    alias: {
      '@api': " api ",
      '@qa': ""
    },
}
Menu