Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 

60 строки
1.2 KiB

  1. import babel from 'rollup-plugin-babel';
  2. import resolve from 'rollup-plugin-node-resolve';
  3. import uglify from 'rollup-plugin-uglify';
  4. import { minify } from 'uglify-es';
  5. const name = 'AutosizeInput';
  6. const path = 'dist/react-input-autosize';
  7. const globals = {
  8. 'prop-types': 'PropTypes',
  9. 'react-dom': 'ReactDOM',
  10. 'react': 'React',
  11. };
  12. const external = Object.keys(globals);
  13. const babelOptions = production => {
  14. let result = {
  15. babelrc: false,
  16. presets: [['es2015', { modules: false }], 'stage-2', 'react'],
  17. plugins: ['external-helpers'],
  18. };
  19. if (production) {
  20. result.plugins.push('transform-react-remove-prop-types');
  21. }
  22. return result;
  23. };
  24. export default [
  25. {
  26. input: 'src/AutosizeInput.js',
  27. output: {
  28. file: path + '.es.js',
  29. format: 'es',
  30. },
  31. external: external,
  32. plugins: [babel(babelOptions(false))],
  33. },
  34. {
  35. input: 'src/AutosizeInput.js',
  36. output: {
  37. name: name,
  38. file: path + '.js',
  39. format: 'umd',
  40. },
  41. globals: globals,
  42. external: external,
  43. plugins: [babel(babelOptions(false)), resolve()],
  44. },
  45. {
  46. input: 'src/AutosizeInput.js',
  47. output: {
  48. name: name,
  49. file: path + '.min.js',
  50. format: 'umd',
  51. },
  52. globals: globals,
  53. external: external,
  54. plugins: [babel(babelOptions(true)), resolve(), uglify({}, minify)],
  55. },
  56. ];