rollup.config.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. import progress from 'rollup-plugin-progress'
  2. import postcss from 'rollup-plugin-postcss'
  3. import cssnext from 'postcss-cssnext'
  4. import buble from 'rollup-plugin-buble'
  5. import html from 'rollup-plugin-html'
  6. import autoprefixer from 'autoprefixer'
  7. import clean from 'postcss-clean'
  8. import atImport from 'postcss-import'
  9. import nodeResolve from 'rollup-plugin-node-resolve'
  10. import replace from 'rollup-plugin-replace'
  11. import commonJs from 'rollup-plugin-commonjs'
  12. import license from 'rollup-plugin-license'
  13. var pkg = require('./package.json')
  14. /**
  15. * Created by peak on 2017/1/6.
  16. */
  17. export default {
  18. entry: 'src/index.js',
  19. dest: 'dist/vue-html5-editor.js',
  20. format: 'umd',
  21. moduleName: "VueHtml5Editor",
  22. plugins: [
  23. license({
  24. banner: `Vue-html5-editor ${pkg.version}\n${pkg.repository.url}\nbuild at ${new Date()}`
  25. }),
  26. progress({
  27. clearLine: false
  28. }),
  29. replace({
  30. VERSION: JSON.stringify(pkg.version)
  31. }),
  32. postcss({
  33. plugins: [
  34. atImport(),
  35. cssnext({
  36. warnForDuplicates: false
  37. }),
  38. autoprefixer(),
  39. clean()
  40. ],
  41. extensions: ['.css', '.pcss']
  42. }),
  43. html({
  44. include: '**/*.html',
  45. htmlMinifierOptions: {
  46. collapseWhitespace: true,
  47. collapseBooleanAttributes: true,
  48. conservativeCollapse: true
  49. }
  50. }),
  51. commonJs({
  52. include: 'node_modules/lrz/**'
  53. }),
  54. nodeResolve({jsnext: true}),
  55. buble({
  56. include: '**/*.js'
  57. })
  58. ]
  59. }