You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
1.3 KiB

/* eslint-disable @typescript-eslint/no-var-requires */
const path = require('path');
const {
override,
addWebpackModuleRule,
addWebpackPlugin,
addWebpackAlias,
overrideDevServer,
} = require('customize-cra');
const ArcoWebpackPlugin = require('@arco-plugins/webpack-react');
const addLessLoader = require('customize-cra-less-loader');
const setting = require('./src/settings.json');
module.exports = {
webpack: override(
addLessLoader({
lessLoaderOptions: {
lessOptions: {},
},
}),
addWebpackModuleRule({
test: /\.svg$/,
loader: '@svgr/webpack',
}),
addWebpackPlugin(
new ArcoWebpackPlugin({
theme: '@arco-themes/react-arco-pro',
modifyVars: {
'arcoblue-6': setting.themeColor,
},
})
),
addWebpackAlias({
'@': path.resolve(__dirname, 'src'),
})
),
devServer: overrideDevServer((config) => {
config.proxy = {
'/luoo-music': {
target: 'http://39.103.180.196:9012/luoo-music/',
changeOrigin: true,
pathRewrite: {
'^/luoo-music': '',
},
},
'/user/artist': {
target: 'http://39.103.180.196:9012/user/artist/',
changeOrigin: true,
pathRewrite: {
'^/user/artist': '',
},
},
};
return config;
}),
};