Detailed description
Hello guys. I need your input please. The problem is that the svg file is not created.
Βelow you will see what I have done.
I would be grateful for any help.
webpack.config.js
module.exports = {
resolve: {
alias: {
'@createSvg': path.resolve(__dirname, './resources/img/icons')
}
}
};
webpack.mix.js
require('laravel-mix-svg-sprite');
Config.svgSprite = {
loaderOptions: {
extract: true
},
pluginOptions: {
plainSprite: true
}
};
mix.js('resources/js/index.js', 'public/js')
.sass('resources/sass/app.scss', 'public/css')
.svgSprite(
'@createSvg',
'public/img/sprite.svg'
)
.extract();
index.js (my app.js file)
function requireAll(r) {
r.keys().forEach(r);
}
requireAll(require.context('@createSvg', true, /\.svg$/));
Your environment
- Version used (e.g. Node 10 and Laravel Mix 5.0.1):
- Operating system and version Windows 10: