import path from 'path'; const config = { projectName: 'fs-wxapp-taro3', date: '2020-12-7', designWidth: 750, deviceRatio: { 640: 2.34 / 2, 750: 1, 828: 1.81 / 2 }, sourceRoot: 'src', outputRoot: 'dist', plugins: [], defineConstants: { }, alias: { '@/components': path.resolve(__dirname, '..', 'src/components'), '@/actions': path.resolve(__dirname, '..', 'src/actions'), '@/utils': path.resolve(__dirname, '..', 'src/utils'), '@/hooks': path.resolve(__dirname, '..', 'src/hooks'), '@/services': path.resolve(__dirname, '..', 'src/services'), '@/constants': path.resolve(__dirname, '..', 'src/constants'), }, copy: { patterns: [ { from: 'src/components/vant-weapp/wxs', to: 'dist/components/vant-weapp/wxs' }, { from: 'src/components/vant-weapp/common/style', to: 'dist/components/vant-weapp/common/style' }, { from: 'src/components/vant-weapp/common/index.wxss', to: 'dist/components/vant-weapp/common/index.wxss' }, { from: 'src/components/vant-weapp/button/index.wxs', to: 'dist/components/vant-weapp/button/index.wxs' }, { from: 'src/components/vant-weapp/icon/index.wxs', to: 'dist/components/vant-weapp/icon/index.wxs' }, { from: 'src/components/vant-weapp/loading/index.wxs', to: 'dist/components/vant-weapp/loading/index.wxs' }, { from: 'src/components/vant-weapp/popup/index.wxs', to: 'dist/components/vant-weapp/popup/index.wxs' }, { from: 'src/components/vant-weapp/cell/index.wxs', to: 'dist/components/vant-weapp/cell/index.wxs' }, { from: 'src/components/vant-weapp/dropdown-menu/index.wxs', to: 'dist/components/vant-weapp/dropdown-menu/index.wxs' }, { from: 'src/components/vant-weapp/transition/index.wxs', to: 'dist/components/vant-weapp/transition/index.wxs' }, { from: 'src/components/vant-weapp/tag/index.wxs', to: 'dist/components/vant-weapp/tag/index.wxs' }, { from: 'src/components/vant-weapp/row/index.wxs', to: 'dist/components/vant-weapp/row/index.wxs' }, { from: 'src/components/vant-weapp/col/index.wxs', to: 'dist/components/vant-weapp/col/index.wxs' }, ], options: { } }, framework: 'react', mini: { postcss: { pxtransform: { enable: true, config: { selectorBlackList: [/van-/] } }, url: { enable: true, config: { limit: 1024 // 设定转换尺寸上限 } }, cssModules: { enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true config: { namingPattern: 'module', // 转换模式,取值为 global/module generateScopedName: '[name]__[local]___[hash:base64:5]' } } } }, h5: { publicPath: '/', staticDirectory: 'static', postcss: { autoprefixer: { enable: true, config: { } }, cssModules: { enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true config: { namingPattern: 'module', // 转换模式,取值为 global/module generateScopedName: '[name]__[local]___[hash:base64:5]' } } } } } module.exports = function (merge) { if (process.env.NODE_ENV === 'development') { return merge({}, config, require('./dev')) } return merge({}, config, require('./prod')) }