1
0

config.js 1.8 KB

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