preload-webpack-plugin
preload-webpack-plugin copied to clipboard
I tried your config and it works, resulting html has prefetch and preload links. I myself have config which preloads fonts and prefetches js and css and it works. Perhaps something else doesn't work in yout case. Are you using version 2?
I tried your config and it works, resulting html has prefetch and preload links. I myself have config which preloads fonts and prefetches js and css and it works. Perhaps something else doesn't work in yout case. Are you using version 2?
new PreloadWebpackPlugin({
rel: 'preload',
as(entry) {
if (/\.(woff(2)?)(\?v=[0-9]\.[0-9]\.[0-9])?$/.test(entry)) {
return 'font';
}
},
fileWhitelist: [/\.(woff(2)?)(\?v=[0-9]\.[0-9]\.[0-9])?$/],
include: 'allAssets'
}),
new PreloadWebpackPlugin({
rel: 'prefetch',
}),
Originally posted by @lkarmelo in https://github.com/vuejs/preload-webpack-plugin/issues/22#issuecomment-898909275
different type of resource can use type to divide. when same type of resource are used in our project ,how to divide? ` import(/* webpackPreload: true */'./abc1.js') .then(({ default: s} ) => console.log(s))
import(/* webpackPrefetch: true */ './abc2.js') .then(({ default: s} ) => console.log(s)) `