config.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. ],
  21. /**
  22. * @description 要引入到组件中的外部样式(css)
  23. * 仅支持标签名和 class 选择器
  24. */
  25. externStyle: '',
  26. /**
  27. * @description 要引入到模板中的自定义标签(ad 等)
  28. * 每个标签为一个 object,包含 name(标签名,必要)、attrs(属性列表,非必要)、platforms(需要添加的平台,非必要)
  29. */
  30. customElements: [
  31. /*
  32. // 需要使用广告标签则打开此注释
  33. {
  34. name: 'ad',
  35. attrs: ['unit-id']
  36. }
  37. */
  38. ],
  39. /**
  40. * @description babel 配置(es6 转 es5)
  41. * @tutorial https://babeljs.io/docs/usage/options/
  42. */
  43. babel: {
  44. presets: ['@babel/env']
  45. },
  46. /**
  47. * @description js 压缩配置
  48. * @tutorial https://www.npmjs.com/package/uglify-js#minify-options
  49. */
  50. uglify: {
  51. mangle: {
  52. toplevel: true
  53. },
  54. output: {
  55. comments: /^!/
  56. }
  57. },
  58. /**
  59. * @description html 压缩配置
  60. * @tutorial https://github.com/kangax/html-minifier#options-quick-reference
  61. */
  62. htmlmin: {
  63. caseSensitive: true,
  64. collapseWhitespace: true,
  65. removeComments: true,
  66. keepClosingSlash: true
  67. },
  68. /**
  69. * @description css 压缩配置
  70. * @tutorial https://github.com/jakubpawlowicz/clean-css#constructor-options
  71. */
  72. cleanCss: {
  73. }
  74. }