config.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. import process from 'process';
  2. /**
  3. * Configuration for the build process
  4. *
  5. * Distinction of development and production builds is made by user-provided node environment variable
  6. * By default, the development target will be built
  7. *
  8. * development: `gulp ...`
  9. * production: `NODE_ENV=production gulp ...`
  10. *
  11. * Additionally, if the web app has access to an API, the distinction between 'online' and 'offline' modes
  12. * is made by user-provided command line argument
  13. * If no argument is given, the 'online' version will be built
  14. *
  15. * development / offline: `gulp --api-mode=offline`
  16. */
  17. export default {
  18. currentTarget: process.env.NODE_ENV || 'development',
  19. currentMode: 'offline', // There is no online mode available for this module
  20. targets: {
  21. development: {
  22. delimiter: '',
  23. infix: ''
  24. },
  25. production: {
  26. delimiter: '.',
  27. infix: 'min'
  28. }
  29. },
  30. modes: {
  31. offline: {
  32. delimiter: '',
  33. infix: ''
  34. }
  35. },
  36. // .eslintcr.yml is not being read?
  37. eslint: {
  38. development: {
  39. rules: {
  40. 'no-console': 0,
  41. 'no-warning-comments': 0
  42. },
  43. plugins: [ 'react' ]
  44. },
  45. production: {
  46. rules: {
  47. 'no-console': 1,
  48. 'no-warning-comments': [ 1, { terms: [ 'todo', 'fixme' ], location: 'start' } ]
  49. },
  50. plugins: [ 'react' ]
  51. }
  52. },
  53. // htmlhint configuration
  54. htmlhintrc: '.htmlhintrc',
  55. // gulp-sass configuration
  56. sass: {
  57. development: {
  58. outputStyle: 'nested'
  59. },
  60. production: {
  61. outputStyle: 'nested',
  62. sourceMap: false
  63. }
  64. },
  65. fileNames: {
  66. css: 'main',
  67. html: 'index',
  68. js: 'main',
  69. jsx: 'main'
  70. },
  71. paths: {
  72. src: 'src',
  73. dest: 'public',
  74. assets: 'assets',
  75. css: 'css',
  76. fonts: 'fonts',
  77. html: 'html',
  78. js: 'js',
  79. images: 'img',
  80. sass: 'scss',
  81. sprites: 'sprites'
  82. },
  83. // browsersync configuration
  84. server: {
  85. baseDir: './public/',
  86. index: 'index.html'
  87. },
  88. logLevel: 'silent'
  89. };