1 | const config = {
|
2 | projectName: '<%= projectName %>',
|
3 | date: '<%= date %>',
|
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 | defineConstants: {
|
14 | },
|
15 | copy: {
|
16 | patterns: [
|
17 | ],
|
18 | options: {
|
19 | }
|
20 | },
|
21 | framework: '<%= framework %>',
|
22 | mini: {
|
23 | postcss: {
|
24 | pxtransform: {
|
25 | enable: true,
|
26 | config: {
|
27 |
|
28 | }
|
29 | },
|
30 | url: {
|
31 | enable: true,
|
32 | config: {
|
33 | limit: 1024
|
34 | }
|
35 | },
|
36 | cssModules: {
|
37 | enable: false,
|
38 | config: {
|
39 | namingPattern: 'module',
|
40 | generateScopedName: '[name]__[local]___[hash:base64:5]'
|
41 | }
|
42 | }
|
43 | }
|
44 | },
|
45 | h5: {
|
46 | publicPath: '/',
|
47 | staticDirectory: 'static',
|
48 | postcss: {
|
49 | autoprefixer: {
|
50 | enable: true,
|
51 | config: {
|
52 | }
|
53 | },
|
54 | cssModules: {
|
55 | enable: false,
|
56 | config: {
|
57 | namingPattern: 'module',
|
58 | generateScopedName: '[name]__[local]___[hash:base64:5]'
|
59 | }
|
60 | }
|
61 | }
|
62 | }
|
63 | }
|
64 |
|
65 | module.exports = function (merge) {
|
66 | if (process.env.NODE_ENV === 'development') {
|
67 | return merge({}, config, require('./dev'))
|
68 | }
|
69 | return merge({}, config, require('./prod'))
|
70 | }
|