别名配置

  1. const {resolve} = require('path')
  2. export default {
  3. alias: {
  4. '/@/': resolve(__dirname, 'src'),
  5. '/components/': resolve(__dirname, "src/components"),
  6. '/style/': resolve(__dirname, "src/assets/style"),
  7. '/images/': resolve(__dirname, "src/assets/images")
  8. }
  9. }
  10. //使用
  11. import HelloWorld from '/components/HelloWorld.vue'