babel.config.js 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. module.exports = {
  2. presets: [
  3. [
  4. '@babel/preset-env', {
  5. targets: {
  6. chrome: '41',
  7. firefox: '34',
  8. ie: '9',
  9. safari: '9',
  10. browsers: ['last 3 versions']
  11. },
  12. exclude: [
  13. 'transform-regenerator',
  14. 'es6.typed.array-buffer',
  15. 'es6.typed.data-view',
  16. 'es6.typed.int8-array',
  17. 'es6.typed.uint8-array',
  18. 'es6.typed.uint8-clamped-array',
  19. 'es6.typed.int16-array',
  20. 'es6.typed.uint16-array',
  21. 'es6.typed.int32-array',
  22. 'es6.typed.uint32-array',
  23. 'es6.typed.float32-array',
  24. 'es6.typed.float64-array',
  25. 'es6.reflect.apply',
  26. 'es6.reflect.construct',
  27. 'es6.reflect.define-property',
  28. 'es6.reflect.delete-property',
  29. 'es6.reflect.get',
  30. 'es6.reflect.get-own-property-descriptor',
  31. 'es6.reflect.get-prototype-of',
  32. 'es6.reflect.has',
  33. 'es6.reflect.is-extensible',
  34. 'es6.reflect.own-keys',
  35. 'es6.reflect.prevent-extensions',
  36. 'es6.reflect.set',
  37. 'es6.reflect.set-prototype-of',
  38. 'es6.math.acosh',
  39. 'es6.math.acosh',
  40. 'es6.math.asinh',
  41. 'es6.math.atanh',
  42. 'es6.math.cbrt',
  43. 'es6.math.clz32',
  44. 'es6.math.cosh',
  45. 'es6.math.expm1',
  46. 'es6.math.fround',
  47. 'es6.math.hypot',
  48. 'es6.math.imul',
  49. 'es6.math.log1p',
  50. 'es6.math.log10',
  51. 'es6.math.log2',
  52. 'es6.math.sign',
  53. 'es6.math.sinh',
  54. 'es6.math.tanh',
  55. 'es6.math.tanh',
  56. 'es6.math.trunc',
  57. 'web.timers'
  58. ],
  59. modules: false,
  60. debug: false,
  61. useBuiltIns: 'entry'
  62. }]
  63. ],
  64. plugins: [
  65. ['@babel/plugin-proposal-object-rest-spread', { useBuiltIns: true }],
  66. ['transform-inline-environment-variables']
  67. ],
  68. env: {
  69. commonjs: {
  70. plugins: [
  71. ['@babel/plugin-transform-modules-commonjs', { loose: true }]
  72. ]
  73. },
  74. commonjs_dist: {
  75. plugins: [
  76. ['@babel/plugin-transform-modules-commonjs', { loose: true }],
  77. ['babel-plugin-transform-require-ignore', { extensions: ['.css'] }]
  78. ]
  79. },
  80. commonjs_e2e: {
  81. presets: [
  82. [
  83. '@babel/preset-env', {
  84. targets: {
  85. chrome: '41',
  86. firefox: '34',
  87. ie: '9',
  88. safari: '9',
  89. browsers: ['last 3 versions']
  90. },
  91. exclude: [
  92. 'transform-regenerator',
  93. 'es6.typed.array-buffer',
  94. 'es6.typed.data-view',
  95. 'es6.typed.int8-array',
  96. 'es6.typed.uint8-array',
  97. 'es6.typed.uint8-clamped-array',
  98. 'es6.typed.int16-array',
  99. 'es6.typed.uint16-array',
  100. 'es6.typed.int32-array',
  101. 'es6.typed.uint32-array',
  102. 'es6.typed.float32-array',
  103. 'es6.typed.float64-array',
  104. 'es6.reflect.apply',
  105. 'es6.reflect.construct',
  106. 'es6.reflect.define-property',
  107. 'es6.reflect.delete-property',
  108. 'es6.reflect.get',
  109. 'es6.reflect.get-own-property-descriptor',
  110. 'es6.reflect.get-prototype-of',
  111. 'es6.reflect.has',
  112. 'es6.reflect.is-extensible',
  113. 'es6.reflect.own-keys',
  114. 'es6.reflect.prevent-extensions',
  115. 'es6.reflect.set',
  116. 'es6.reflect.set-prototype-of',
  117. 'es6.math.acosh',
  118. 'es6.math.acosh',
  119. 'es6.math.asinh',
  120. 'es6.math.atanh',
  121. 'es6.math.cbrt',
  122. 'es6.math.clz32',
  123. 'es6.math.cosh',
  124. 'es6.math.expm1',
  125. 'es6.math.fround',
  126. 'es6.math.hypot',
  127. 'es6.math.imul',
  128. 'es6.math.log1p',
  129. 'es6.math.log10',
  130. 'es6.math.log2',
  131. 'es6.math.sign',
  132. 'es6.math.sinh',
  133. 'es6.math.tanh',
  134. 'es6.math.tanh',
  135. 'es6.math.trunc',
  136. 'web.timers'
  137. ],
  138. modules: false,
  139. debug: false,
  140. useBuiltIns: 'entry'
  141. }]
  142. ],
  143. plugins: [
  144. ['@babel/plugin-transform-modules-commonjs', { loose: true }],
  145. [
  146. 'babel-plugin-forbidden-imports', {
  147. allowedModules: [
  148. '@babel/polyfill/*',
  149. 'window',
  150. 'jasmine-co',
  151. 'core-js/*',
  152. 'regenerator-runtime/runtime',
  153. './common',
  154. './../bootstrap',
  155. './helpers/custom-matchers',
  156. './asciiTable',
  157. './MemoryLeakTest',
  158. '../MemoryLeakTest'
  159. ]
  160. }]
  161. ]
  162. },
  163. es: {
  164. plugins: [
  165. ['babel-plugin-transform-require-ignore', { extensions: ['.css'] }]
  166. ]
  167. }
  168. },
  169. ignore: [
  170. 'src/3rdparty/walkontable/dist/*',
  171. 'src/3rdparty/walkontable/test/dist/*'
  172. ]
  173. };