@jeffjade
2018-06-12T16:09:54.000000Z
字数 987
阅读 1395
Webpack
Vue-Cli3
// https://github.com/GoogleChromeLabs/prerender-loader
// https://github.com/GoogleChromeLabs/prerender-loader/issues/3
config.module
.rule('html')
.include
.add('prerender-loader?string')
config.module
.rule('html')
.use('prerender-loader?string')
.loader('prerender-loader?string')
config
.plugin('html')
.tap(args => {
console.log(args[0])
const indexFile = resolveRealPath('public/index.html')
console.log(indexFile)
args[0].template = '!!prerender-loader?string!public/index.html'
return args
})
config.module
.rule('svg')
.enforce('pre')
.use('svgo-loader?' + JSON.stringify(svgoConfig))
.loader('svgo-loader')
config.module
.rule('svg')
.use('vue-svg-loader')
.tap(options => {
console.log(options)
merge(options, {
plugins: [
{removeDoctype: true},
{removeComments: true}
]
})
})
.loader('vue-svg-loader')
config.module
.rule('svg')
.enforce('pre')
.use('vue-svg-loader')
.tap(options => {
console.log(options)
merge(options, {
plugins: [
{removeDoctype: true},
{removeComments: true}
]
})
})
.loader('vue-svg-loader')a