123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- import { defineConfig } from "@tarojs/cli";
-
- const path = require("path");
-
- import devConfig from "./dev";
- import prodConfig from "./prod";
-
- export default defineConfig(async (merge, { command, mode }) => {
- const config = {
- projectName: "civilized-miniapp",
- date: "2024-03-21",
- designWidth: 750,
- deviceRatio: {
- 640: 2.34 / 2,
- 750: 1,
- 828: 1.81 / 2,
- },
-
- sourceRoot: "src",
- outputRoot: "dist",
- plugins: [],
- defineConstants: {},
- copy: {
- patterns: [{ from: "src/assets/tabbar/", to: "dist/assets/tabbar/" }],
- options: {},
- },
- framework: "react",
- compiler: "webpack4",
- alias: {
- "@": path.resolve(__dirname, "..", "src"),
- },
-
- mini: {
- postcss: {
- pxtransform: {
- enable: true,
- config: {},
- },
- url: {
- enable: true,
- config: {
- limit: 1024,
- },
- },
- cssModules: {
- enable: true,
- config: {
- namingPattern: "module",
- generateScopedName: "[name]__[local]___[hash:base64:5]",
- },
- },
- },
- },
- h5: {
- publicPath: "/",
- staticDirectory: "static",
- outputDir: 'dist',
- router : {
- mode : "hash",
-
- },
-
-
-
-
- miniCssExtractPluginOption: {
- ignoreOrder: true,
- filename: "css/[name].[hash].css",
- chunkFilename: "css/[name].[chunkhash].css",
- },
- postcss: {
- autoprefixer: {
- enable: true,
- config: {},
- },
- cssModules: {
- enable: false,
- config: {
- namingPattern: "module",
- generateScopedName: "[name]__[local]___[hash:base64:5]",
- },
- },
- },
-
-
-
-
-
-
-
-
-
-
-
-
-
- },
-
- };
- if (process.env.NODE_ENV === "development") {
- return merge({}, config, devConfig);
- }
- return merge({}, config, prodConfig);
- });
|