LOCKING项目小程序端
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 

76 linhas
1.6 KiB

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