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

Laravel mix configuration #197

Open
el-jacko opened this issue Jul 8, 2022 · 0 comments
Open

Laravel mix configuration #197

el-jacko opened this issue Jul 8, 2022 · 0 comments

Comments

@el-jacko
Copy link

el-jacko commented Jul 8, 2022

Hi, i'm using this plugin successfully in one of my vue projects. Now i'm trying to use it in an Laravel project. But it's not working, an svg element is added to the code but it's empty. Furthermore, the used svg files are copied in to the public folder, but there is js inside of the svg files ...

I added the following to my webpack.mix.js:

mix.webpackConfig({
    module: {
        rules: [
            {
                test: /\.svg$/,
                include: [svgFilePath],
                use: [
                    {
                        loader: '@yzfe/svgicon-loader',
                        options: {
                            svgFilePath: [svgFilePath],
                            svgoConfig: null
                        }
                    }
                ]
            }
        ]
    },
...
})
mix.options({
    vue: {
        transformAssetUrls: {
            ['v2-icon']: 'data'
        }
    }
})

Does anyone has this plugin running with laravel mix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant