chainWebpack: (config) => {
config.plugin("PreloadWebpackPlugin").use(PreloadWebpackPlugin, [
{
rel: "preload",
as(entry) {
if (/\.css$/.test(entry)) return "style";
if (/\.woff$/.test(entry)) return "font";
if (/\.png$/.test(entry)) return "image";
return "script";
},
},
]);
}
TypeError: compiler.plugin is not a function
at PreloadPlugin.apply