mirror of
http://112.124.100.131/ebiz-ai/ebiz-base-ai.git
synced 2025-12-10 03:16:49 +08:00
feat(product): 添加产品推荐功能并优化相关页面
- 新增产品推荐页面,提供个性化的产品推荐服务 - 优化首页布局,增加产品推荐入口 - 调整聊天组件,支持产品推荐功能 - 优化样式文件,统一主题颜色和样式 - 更新路由配置,添加产品推荐路由
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
const autoprefixer = require('autoprefixer');
|
||||
const pxtoviewport = require('postcss-px-to-viewport');
|
||||
const path = require('path');
|
||||
const autoprefixer = require('autoprefixer')
|
||||
const pxtoviewport = require('postcss-px-to-viewport')
|
||||
const path = require('path')
|
||||
|
||||
function resolve(dir) {
|
||||
return path.join(__dirname, dir);
|
||||
return path.join(__dirname, dir)
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
@@ -12,37 +12,36 @@ module.exports = {
|
||||
outputDir: 'dist',
|
||||
productionSourceMap: false,
|
||||
devServer: {
|
||||
https: false,
|
||||
https: true,
|
||||
host: '0.0.0.0',
|
||||
disableHostCheck: true,
|
||||
},
|
||||
css: {
|
||||
sourceMap: true,
|
||||
loaderOptions: {
|
||||
loaderOptions: {
|
||||
postcss: {
|
||||
postcssOptions: {
|
||||
plugins: [
|
||||
autoprefixer(), // 自动加浏览器前缀
|
||||
pxtoviewport({ // px 转 viewport
|
||||
pxtoviewport({
|
||||
// px 转 viewport
|
||||
viewportWidth: 375,
|
||||
selectorBlackList: ['van-circle__layer'] // 排除vant circle组件样式转换
|
||||
})
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
selectorBlackList: ['van-circle__layer'], // 排除vant circle组件样式转换
|
||||
}),
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
chainWebpack: (config) => {
|
||||
// 设置路径别名
|
||||
config.resolve.alias
|
||||
.set('@', resolve('src'))
|
||||
.set('@utils', resolve('src/assets/js/utils'));
|
||||
config.resolve.alias.set('@', resolve('src')).set('@utils', resolve('src/assets/js/utils'))
|
||||
|
||||
// 移除 prefetch 插件(减少初始加载体积)
|
||||
config.plugins.delete('prefetch');
|
||||
config.plugins.delete('prefetch')
|
||||
|
||||
// SVG 图标配置
|
||||
config.module.rule('svg').exclude.add(resolve('src/icons')).end();
|
||||
config.module.rule('svg').exclude.add(resolve('src/icons')).end()
|
||||
config.module
|
||||
.rule('icons')
|
||||
.test(/\.svg$/)
|
||||
@@ -52,7 +51,7 @@ module.exports = {
|
||||
.loader('svg-sprite-loader')
|
||||
.options({
|
||||
symbolId: 'icon-[name]',
|
||||
});
|
||||
})
|
||||
|
||||
// 处理 .mjs 文件(用于 mermaid 等模块)
|
||||
config.module
|
||||
@@ -61,7 +60,7 @@ module.exports = {
|
||||
.include.add(/node_modules/)
|
||||
.end()
|
||||
.use('babel-loader')
|
||||
.loader('babel-loader');
|
||||
.loader('babel-loader')
|
||||
|
||||
// 添加对现代 JS 的支持(如 ?? 和 ?.)
|
||||
config.module
|
||||
@@ -71,19 +70,19 @@ module.exports = {
|
||||
.loader('babel-loader')
|
||||
.options({
|
||||
presets: ['@babel/preset-env'],
|
||||
});
|
||||
})
|
||||
},
|
||||
configureWebpack: (config) => {
|
||||
// 强制使用 CommonJS 模块加载 mermaid
|
||||
config.resolve = config.resolve || {};
|
||||
config.resolve.alias = config.resolve.alias || {};
|
||||
config.resolve = config.resolve || {}
|
||||
config.resolve.alias = config.resolve.alias || {}
|
||||
// config.resolve.alias.mermaid$ = path.resolve(
|
||||
// __dirname,
|
||||
// './node_modules/mermaid/dist/mermaid.common.js'
|
||||
// );
|
||||
|
||||
// Webpack devtool 设置
|
||||
config.devtool = 'source-map';
|
||||
config.devtool = 'source-map'
|
||||
|
||||
// 打包性能提示设置
|
||||
config.performance = {
|
||||
@@ -91,8 +90,8 @@ module.exports = {
|
||||
maxEntrypointSize: 7168000, // 7MB
|
||||
maxAssetSize: 7168000, // 7MB
|
||||
assetFilter: function (assetFilename) {
|
||||
return assetFilename.endsWith('.js');
|
||||
return assetFilename.endsWith('.js')
|
||||
},
|
||||
};
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user