Files
taro-template/config/prod.ts
abearxiong 7b760d20f3 feat: update project configuration and structure
- Updated project.config.json with new project name and settings.
- Removed unused app.scss and index.scss files, replaced with CSS files.
- Refactored app.ts to utilize Taro's useLaunch hook for app initialization.
- Simplified index.tsx to display a basic greeting and user info button.
- Added new project.xhs.json for XHS platform configuration.
- Introduced is-xhs utility function to check for XHS environment.
- Updated tsconfig.json to include path mappings and additional include paths.
2026-03-12 17:45:09 +08:00

34 lines
1.2 KiB
TypeScript

import type { UserConfigExport } from "@tarojs/cli"
export default {
mini: {},
h5: {
/**
* WebpackChain 插件配置
* @docs https://github.com/neutrinojs/webpack-chain
*/
// webpackChain (chain) {
// /**
// * 如果 h5 端编译后体积过大,可以使用 webpack-bundle-analyzer 插件对打包体积进行分析。
// * @docs https://github.com/webpack-contrib/webpack-bundle-analyzer
// */
// chain.plugin('analyzer')
// .use(require('webpack-bundle-analyzer').BundleAnalyzerPlugin, [])
// /**
// * 如果 h5 端首屏加载时间过长,可以使用 prerender-spa-plugin 插件预加载首页。
// * @docs https://github.com/chrisvfritz/prerender-spa-plugin
// */
// const path = require('path')
// const Prerender = require('prerender-spa-plugin')
// const staticDir = path.join(__dirname, '..', 'dist')
// chain
// .plugin('prerender')
// .use(new Prerender({
// staticDir,
// routes: [ '/pages/index/index' ],
// postProcess: (context) => ({ ...context, outputPath: path.join(staticDir, 'index.html') })
// }))
// }
}
} satisfies UserConfigExport<'webpack5'>