[关闭]
@jeffjade 2018-06-12T16:09:54.000000Z 字数 987 阅读 1395

Vue-Cli3 之 Webpack 配置

Webpack Vue-Cli3


  1. // https://github.com/GoogleChromeLabs/prerender-loader
  2. // https://github.com/GoogleChromeLabs/prerender-loader/issues/3
  3. config.module
  4. .rule('html')
  5. .include
  6. .add('prerender-loader?string')
  7. config.module
  8. .rule('html')
  9. .use('prerender-loader?string')
  10. .loader('prerender-loader?string')
  11. config
  12. .plugin('html')
  13. .tap(args => {
  14. console.log(args[0])
  15. const indexFile = resolveRealPath('public/index.html')
  16. console.log(indexFile)
  17. args[0].template = '!!prerender-loader?string!public/index.html'
  18. return args
  19. })
  1. config.module
  2. .rule('svg')
  3. .enforce('pre')
  4. .use('svgo-loader?' + JSON.stringify(svgoConfig))
  5. .loader('svgo-loader')
  6. config.module
  7. .rule('svg')
  8. .use('vue-svg-loader')
  9. .tap(options => {
  10. console.log(options)
  11. merge(options, {
  12. plugins: [
  13. {removeDoctype: true},
  14. {removeComments: true}
  15. ]
  16. })
  17. })
  18. .loader('vue-svg-loader')
  1. config.module
  2. .rule('svg')
  3. .enforce('pre')
  4. .use('vue-svg-loader')
  5. .tap(options => {
  6. console.log(options)
  7. merge(options, {
  8. plugins: [
  9. {removeDoctype: true},
  10. {removeComments: true}
  11. ]
  12. })
  13. })
  14. .loader('vue-svg-loader')a
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注