const CracoLessPlugin = require('craco-less'); const HtmlWebpackPlugin=require('html-webpack-plugin') const path = require('path'); module.exports = { plugins: [ { plugin: CracoLessPlugin, options: { lessLoaderOptions: { lessOptions: { modifyVars: { '@primary-color': '#800080' }, javascriptEnabled: true, }, }, }, }, ], webpack: { configure: (webpackConfig, { env, paths }) => { // 修改output.publicPath为'./' // webpackConfig.output.publicPath = './'; webpackConfig.output.path = path.join(__dirname,); webpackConfig.output.publicPath = ""; return webpackConfig; }, } };