SoFunction
Updated on 2025-04-04

Briefly describe the config configuration in vue

Configure aliases and extensions in files

resolve: {
  extensions: ['.js', '.vue', '.json', '.styl'],
  alias: {
   'vue$': 'vue/dist/',
   '@': resolve('src'),
   'src': (__dirname, '../src'),
   'common': (__dirname, '../src/common'),
   'components': (__dirname, '../src/components')
  }
 }

After configuring the alias and extensions, you can write this

import Vue from 'vue';
import App from './App';
import Router from 'vue-router';
// Components can be preceded by '@/', or omitted without writing//If there is no alias, it should be written as "import goods from '../components/goods/goods';"import goods from 'components/goods/goods';
import seller from 'components/seller/seller';
import ratings from 'components/ratings/ratings';
import '@/common/stylus/index';

Summarize

The above is the config configuration in vue introduced to you by the editor. I hope it will be helpful to you. If you have any questions, please leave me a message and the editor will reply to you in time. Thank you very much for your support for my website!