Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The svg file is not created when using an alias for the directory containing your SVG files #12

Open
nikosdrog opened this issue Feb 22, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@nikosdrog
Copy link

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:
@JaZo
Copy link
Member

JaZo commented Feb 22, 2021

This package currently doesn't support aliases for the directory containing your SVG files. Feel free to open a PR to support this!

@JaZo JaZo added the enhancement New feature or request label Feb 22, 2021
@JaZo JaZo changed the title The svg file is not created The svg file is not created when using an alias for the directory containing your SVG files Feb 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants