You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
1.4 KiB
JavaScript
51 lines
1.4 KiB
JavaScript
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
/** @type {import('next').NextConfig} */
|
|
const path = require('path');
|
|
const withLess = require('next-with-less');
|
|
const withTM = require('next-transpile-modules')([
|
|
'@arco-design/web-react',
|
|
'@arco-themes/react-arco-pro',
|
|
'@xyflow/react',
|
|
'@xyflow/system'
|
|
]);
|
|
|
|
const setting = require("./src/settings.json");
|
|
|
|
module.exports = withLess(
|
|
withTM({
|
|
lessLoaderOptions: {
|
|
lessOptions: {
|
|
modifyVars: {
|
|
'arcoblue-6': setting.themeColor,
|
|
},
|
|
},
|
|
},
|
|
webpack: (config) => {
|
|
config.module.rules.push({
|
|
test: /\.svg$/,
|
|
use: ['@svgr/webpack'],
|
|
});
|
|
|
|
config.resolve.alias['@/assets'] = path.resolve(
|
|
__dirname,
|
|
'./src/public/assets'
|
|
);
|
|
config.resolve.alias['@'] = path.resolve(__dirname, './src');
|
|
// 解决 react/jsx-runtime 找不到的问题
|
|
config.resolve.alias['react/jsx-runtime'] = path.resolve(__dirname, './node_modules/react/jsx-runtime.js');
|
|
config.resolve.alias['react/jsx-dev-runtime'] = path.resolve(__dirname, './node_modules/react/jsx-dev-runtime.js');
|
|
|
|
return config;
|
|
},
|
|
async redirects() {
|
|
return [
|
|
{
|
|
source: '/',
|
|
destination: '/dashboard/workplace',
|
|
permanent: true,
|
|
},
|
|
];
|
|
},
|
|
pageExtensions: ['tsx'],
|
|
})
|
|
); |