assistant-note/craco.config.js

47 lines
1.1 KiB
JavaScript
Raw Normal View History

2024-01-12 00:13:58 -05:00
const CracoLessPlugin = require('craco-less');
function resolve(dir) {
return path.join(__dirname, dir);
}
const path = require('path');
2024-01-12 00:13:58 -05:00
module.exports = {
plugins: [
{
plugin: CracoLessPlugin,
options: {
lessLoaderOptions: {
lessOptions: {
modifyVars: { '@primary-color': '#800080' },
javascriptEnabled: true,
},
},
},
},
],
webpack: {
configure: (webpackConfig, { env, paths }) => {
// 修改output.publicPath为'./'
// webpackConfig.output.publicPath = './';
2024-09-10 07:12:24 -04:00
webpackConfig.output.path = path.join(__dirname,"/build");
webpackConfig.output.publicPath = "./";
// webpackConfig.output.module
// .rule("icons")
// .test(/\.svg$/)
// .include.add(resolve("src/icons"))
// .end()
// .use("svg-sprite-loader")
// .loader("svg-sprite-loader")
// .options({
// symbolId: "icon-[name]",
// })
// .end()
return webpackConfig;
},
alias: {
// 将@/*映射为src目录
'@': path.resolve(__dirname, 'src/'),
},
}
};