|
1 | 1 | const config = {
|
2 |
| - projectName: 'data', |
3 |
| - date: '2022-4-16', |
4 |
| - designWidth: 750, |
5 |
| - deviceRatio: { |
6 |
| - 640: 2.34 / 2, |
7 |
| - 750: 1, |
8 |
| - 828: 1.81 / 2 |
9 |
| - }, |
10 |
| - sourceRoot: 'src', |
11 |
| - outputRoot: 'dist', |
12 |
| - plugins: [ |
13 |
| - 'tarojs-plugin-platform-nextjs' |
14 |
| - ], |
15 |
| - defineConstants: { |
16 |
| - }, |
17 |
| - copy: { |
18 |
| - patterns: [ |
| 2 | + projectName: 'data', |
| 3 | + date: '2022-4-16', |
| 4 | + designWidth: 375, |
| 5 | + deviceRatio: { |
| 6 | + 640: 2.34 / 2, |
| 7 | + 750: 1, |
| 8 | + 828: 1.81 / 2, |
| 9 | + 375: 2 / 1 |
| 10 | + }, |
| 11 | + sourceRoot: 'src', |
| 12 | + outputRoot: 'dist', |
| 13 | + plugins: [ |
| 14 | + 'tarojs-plugin-platform-nextjs' |
19 | 15 | ],
|
20 |
| - options: { |
21 |
| - } |
22 |
| - }, |
23 |
| - framework: 'react', |
24 |
| - mini: { |
25 |
| - postcss: { |
26 |
| - pxtransform: { |
27 |
| - enable: true, |
28 |
| - config: { |
29 |
| - |
30 |
| - } |
31 |
| - }, |
32 |
| - url: { |
33 |
| - enable: true, |
34 |
| - config: { |
35 |
| - limit: 1024 // 设定转换尺寸上限 |
36 |
| - } |
37 |
| - }, |
38 |
| - cssModules: { |
39 |
| - enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true |
40 |
| - config: { |
41 |
| - namingPattern: 'module', // 转换模式,取值为 global/module |
42 |
| - generateScopedName: '[name]__[local]___[hash:base64:5]' |
| 16 | + defineConstants: { |
| 17 | + }, |
| 18 | + copy: { |
| 19 | + patterns: [ |
| 20 | + ], |
| 21 | + options: { |
43 | 22 | }
|
44 |
| - } |
45 |
| - } |
46 |
| - }, |
47 |
| - h5: { |
48 |
| - publicPath: '/', |
49 |
| - staticDirectory: 'static', |
50 |
| - postcss: { |
51 |
| - autoprefixer: { |
52 |
| - enable: true, |
53 |
| - config: { |
| 23 | + }, |
| 24 | + framework: 'react', |
| 25 | + mini: { |
| 26 | + postcss: { |
| 27 | + pxtransform: { |
| 28 | + enable: true, |
| 29 | + config: { |
| 30 | + |
| 31 | + } |
| 32 | + }, |
| 33 | + url: { |
| 34 | + enable: true, |
| 35 | + config: { |
| 36 | + limit: 1024 // 设定转换尺寸上限 |
| 37 | + } |
| 38 | + }, |
| 39 | + cssModules: { |
| 40 | + enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true |
| 41 | + config: { |
| 42 | + namingPattern: 'module', // 转换模式,取值为 global/module |
| 43 | + generateScopedName: '[name]__[local]___[hash:base64:5]' |
| 44 | + } |
| 45 | + } |
54 | 46 | }
|
55 |
| - }, |
56 |
| - cssModules: { |
57 |
| - enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true |
58 |
| - config: { |
59 |
| - namingPattern: 'module', // 转换模式,取值为 global/module |
60 |
| - generateScopedName: '[name]__[local]___[hash:base64:5]' |
| 47 | + }, |
| 48 | + h5: { |
| 49 | + publicPath: '/', |
| 50 | + staticDirectory: 'static', |
| 51 | + postcss: { |
| 52 | + autoprefixer: { |
| 53 | + enable: true, |
| 54 | + config: { |
| 55 | + } |
| 56 | + }, |
| 57 | + cssModules: { |
| 58 | + enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true |
| 59 | + config: { |
| 60 | + namingPattern: 'module', // 转换模式,取值为 global/module |
| 61 | + generateScopedName: '[name]__[local]___[hash:base64:5]' |
| 62 | + } |
| 63 | + } |
| 64 | + }, |
| 65 | + router: { |
| 66 | + mode: 'browser', |
| 67 | + customRoutes: { |
| 68 | + '/pages/index/index': '/', |
| 69 | + '/pages/stars/index': '/stars' |
| 70 | + } |
61 | 71 | }
|
62 |
| - } |
63 | 72 | }
|
64 |
| - } |
65 | 73 | }
|
66 | 74 |
|
67 | 75 | module.exports = function (merge) {
|
68 |
| - if (process.env.NODE_ENV === 'development') { |
69 |
| - return merge({}, config, require('./dev')) |
70 |
| - } |
71 |
| - return merge({}, config, require('./prod')) |
| 76 | + if (process.env.NODE_ENV === 'development') { |
| 77 | + return merge({}, config, require('./dev')) |
| 78 | + } |
| 79 | + return merge({}, config, require('./prod')) |
72 | 80 | }
|
0 commit comments