123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131 |
- const path = require('path') // eslint-disable-line
- const config = {
- projectName: 'zsdwx3',
- date: '2020-12-16',
- designWidth: 750,
- deviceRatio: {
- 640: 2.34 / 2,
- 750: 1,
- 828: 1.81 / 2,
- },
- sourceRoot: 'src',
- outputRoot: 'dist',
- plugins: [],
- defineConstants: {},
- copy: {
- patterns: [
- {
- from: 'src/loc2.png',
- to: 'dist/static/loc2.png',
- },
- {
- from: 'src/static/nav',
- to: 'dist/static/nav',
- },
- {
- from: 'src/components/Nearby/nearby',
- to: 'dist/components/Nearby/nearby',
- },
- {
- from: 'src/static/wxs/sidebar.wxs',
- to: 'dist/pages/index/sidebar.wxs',
- },
- {
- from: 'src/static/images/pose.png',
- to: 'dist/static/images/pose.png',
- },
- {
- from: 'src/static/images/sec.png',
- to: 'dist/static/images/sec.png',
- },
- {
- from: 'src/static/images/sectop.png',
- to: 'dist/static/images/sectop.png',
- },
- {
- from: 'src/static/images/secbrand.png',
- to: 'dist/static/images/secbrand.png',
- },
- {
- from: 'src/static/images/poseaudio.png',
- to: 'dist/static/images/poseaudio.png',
- },
- {
- from: 'src/static/images/poseaudio.png',
- to: 'dist/static/images/posevisual.png',
- },
- {
- from: 'src/static/ect',
- to: 'dist/static/ect',
- },
- { from: 'src/components/vant/wxs', to: 'dist/components/vant/wxs' },
- {
- from: 'src/components/vant/common/style',
- to: 'dist/components/vant/common/style',
- },
- {
- from: 'src/components/vant/common/index.wxss',
- to: 'dist/components/vant/common/index.wxss',
- },
- {
- from: 'src/components/vant/sticky/index.wxs',
- to: 'dist/components/vant/sticky/index.wxs',
- },
- ],
- options: {},
- },
- framework: 'react',
- alias: {
- '@': path.resolve(__dirname, '..', 'src'),
- '@vant': path.resolve(__dirname, '..', 'src/components/vant'),
- },
- 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'))
- } else if (process.env.NODE_ENV === 'uat') {
- return merge({}, config, require('./uat'))
- }
- return merge({}, config, require('./prod'))
- }
|