webpack配置别名alias

vue/cli2

# build/webpack.base.conf.js 中
resolve: {
     
	alias: {
     
		"pages": "@/pages"
	},
	extensions: ['.js','.vue', '.json']
}

vue/cli3

resolve: {
     
    alias: {
     
      '@': resolve('src'),
      '_c': resolve('src/components')
    }
  }

你可能感兴趣的