Commit 7d53f87b authored by hewenhao's avatar hewenhao

feat: preload

parent 8e07b18e
/* eslint-disable @typescript-eslint/no-var-requires */
const tsImportPluginFactory = require('ts-import-plugin')
const { merge } = require('webpack-merge')
const PreloadPlugin = require('@vue/preload-webpack-plugin')
const createUploadAssetsPlugin = require('@geek/webpack-upload-assets-plugin')
const { defineConfig } = require('@vue/cli-service')
......@@ -48,6 +49,14 @@ module.exports = defineConfig({
return args
})
config
.plugin('prefetch')
.use(PreloadPlugin, [{
rel: 'prefetch',
fileWhitelist: [/\.css$/, /\.js$/],
include: 'asyncChunks'
}]).after('html')
if (shouldUploadAssetsToCdn) {
config
.plugin('cos-upload')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment