config.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /**
  2. * @fileoverview 配置文件
  3. */
  4. module.exports = {
  5. /**
  6. * @description 需要的插件列表
  7. */
  8. plugins: [
  9. // 按需打开注释即可
  10. // 'audio', // 音乐播放器
  11. // 'editable', // 内容编辑
  12. // 'emoji', // 小表情
  13. // 'highlight', // 代码高亮
  14. // 'markdown', // 解析 md
  15. // 'latex', // 解析 latex
  16. // 'search', // 关键词搜索
  17. // 'style', // 解析 style 标签
  18. // 'txv-video', // 使用腾讯视频
  19. // 'img-cache' // 图片缓存
  20. // 'card', // 卡片展示
  21. 'aliyun-video', // 阿里云视频
  22. 'channel-video', // 视频号视频
  23. ],
  24. /**
  25. * @description 要引入到组件中的外部样式(css)
  26. * 仅支持标签名和 class 选择器
  27. */
  28. externStyle: '',
  29. /**
  30. * @description 要引入到模板中的自定义标签(ad 等)
  31. * 每个标签为一个 object,包含 name(标签名,必要)、attrs(属性列表,非必要)、platforms(需要添加的平台,非必要)
  32. */
  33. customElements: [
  34. /*
  35. // 需要使用广告标签则打开此注释
  36. {
  37. name: 'ad',
  38. attrs: ['unit-id']
  39. }
  40. */
  41. ],
  42. /**
  43. * @description babel 配置(es6 转 es5)
  44. * @tutorial https://babeljs.io/docs/usage/options/
  45. */
  46. babel: {
  47. presets: ['@babel/env']
  48. },
  49. /**
  50. * @description js 压缩配置
  51. * @tutorial https://www.npmjs.com/package/uglify-js#minify-options
  52. */
  53. uglify: {
  54. mangle: {
  55. toplevel: true
  56. },
  57. output: {
  58. comments: /^!/
  59. }
  60. },
  61. /**
  62. * @description html 压缩配置
  63. * @tutorial https://github.com/kangax/html-minifier#options-quick-reference
  64. */
  65. htmlmin: {
  66. caseSensitive: true,
  67. collapseWhitespace: true,
  68. removeComments: true,
  69. keepClosingSlash: true
  70. },
  71. /**
  72. * @description css 压缩配置
  73. * @tutorial https://github.com/jakubpawlowicz/clean-css#constructor-options
  74. */
  75. cleanCss: {
  76. }
  77. }