LOCKING项目小程序端
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 

80 行
1.7 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. // webpackChain (chain, webpack) {
  48. // chain.plugin('analyzer')
  49. // .use(require('webpack-bundle-analyzer').BundleAnalyzerPlugin, [])
  50. // }
  51. },
  52. h5: {
  53. publicPath: '/',
  54. staticDirectory: 'static',
  55. postcss: {
  56. autoprefixer: {
  57. enable: true,
  58. config: {
  59. }
  60. },
  61. cssModules: {
  62. enable: true, // 默认为 false,如需使用 css modules 功能,则设为 true
  63. config: {
  64. namingPattern: 'module', // 转换模式,取值为 global/module
  65. generateScopedName: '[name]__[local]___[hash:base64:5]'
  66. }
  67. }
  68. }
  69. }
  70. }
  71. module.exports = function (merge) {
  72. if (process.env.NODE_ENV === 'development') {
  73. return merge({}, config, require('./dev'))
  74. }
  75. return merge({}, config, require('./prod'))
  76. }