Using path to map paths in tsconfig.json, how can the compiled js find the corresponding files?

I set path, in tsconfig.json so that I can easily use the relative path to locate my file:

clipboard.png

clipboard.png

tsc,js,:

clipboard.png

clipboard.png

I would like to ask all the gods, what should I do? Orz


requires path mapping to be set in webpack. For example (just for example! Because the parameter configuration of each framework is different):

alias: {
    '@/components': path.resolve(__dirname, '..', 'src/components'),
    '@/utils': path.resolve(__dirname, '..', 'src/utils'),
    '@/api': path.resolve(__dirname, '..', 'src/api'),
    '@/store': path.resolve(__dirname, '..', 'src/store'),
    '@/constants': path.resolve(__dirname, '..', 'src/constants'),
    '@/mixins': path.resolve(__dirname, '..', 'src/mixins')
  },

tsconfig.json jsconfig.json is a file that is limited to the vscode editor and does not affect the actual situation when the program is executed.


use this, https://www.npmjs.com/package.

Menu