You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constpath=require('path');constSVGSymbolSprite=require('svg-symbol-sprite-loader');// Define the resolve method to obtain the absolute path of the fileconstresolve=dir=>path.join(__dirname,dir);module.exports={// A function that recives a ChainableConfig instance based on webpack chain// Allows more fine-grained modifications to the internal webpack configurationchainWebpack: config=>{// Create and insert sprite before the html bodyconfig.plugin('svg-symbol-sprite-loader').after('html').use(SVGSymbolSprite.Plugin).end();// Configure svg default rultes to exclude svg file proccessing in icons directoryconfig.module.rule('svg').exclude.add(resolve('src/assets/images/icons/svg')).end();// New icons rule, set svg sprite loader to process svg files in the 'src/assets/images/icons/svg' folderconfig.module.rule('svg-sprite').uses.clear().end().test(/\.svg$/u).include.add(resolve('src/assets/images/icons/svg')).end().use('svg-symbol-sprite-loader').loader('svg-symbol-sprite-loader').options({symbolId: filePath=>`icon-${path.basename(filePath,'.svg')}`}).end();}};
The above code works 🚀 , but when I migrated the svg-symbol-sprite-loader package to its 5.0.0 version, I can no longer use that configuration.
Summary
Hi!
I am using the
svg-symbol-sprite-loader
package in version 4.0.0 with the next configuration in thevue.config.js
file.Reference: https://stefan-dietz.eu/vue-svg-symbol-sprites.html
package.json
filevue.config.js
fileThe above code works 🚀 , but when I migrated the
svg-symbol-sprite-loader
package to its 5.0.0 version, I can no longer use that configuration.It requires me to use the
html-webpack-plugin
package for configuration.Reference: https://www.npmjs.com/package/svg-symbol-sprite-loader#user-content-complete
Reproduction Steps
npm i svg-symbol-sprite-loader@">=5.0.0"
html-webpack-plugin
on thevue.config.js
filehow can I make the configuration in the
vue.config.js
file?The text was updated successfully, but these errors were encountered: