From 3b7d8f14c3ace8a4122b6aa95b93c3500fa3c9ac Mon Sep 17 00:00:00 2001 From: 1708-huayu <57060237+1708-huayu@users.noreply.github.com> Date: Tue, 24 Sep 2024 19:07:06 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9Acarco=E6=AD=A3=E5=B8=B8=E5=90=AF?= =?UTF-8?q?=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- craco.config.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/craco.config.js b/craco.config.js index 0c11192..e0ac092 100644 --- a/craco.config.js +++ b/craco.config.js @@ -1,5 +1,4 @@ const CracoLessPlugin = require('craco-less'); -const HtmlWebpackPlugin=require('html-webpack-plugin') const path = require('path'); module.exports = { plugins: [ @@ -15,7 +14,14 @@ module.exports = { }, }, ], + alias: { + // 将@/*映射为src目录 + '@': path.resolve(__dirname, 'src/'), + }, webpack: { + alias:{ + '@': path.resolve(__dirname, 'src/') + }, configure: (webpackConfig, { env, paths }) => { // 修改output.publicPath为'./' // webpackConfig.output.publicPath = './';