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

Issue when trying to use file loader as well as your plugin #100

Open
jack-madebysix opened this issue Jan 5, 2021 · 0 comments
Open

Issue when trying to use file loader as well as your plugin #100

jack-madebysix opened this issue Jan 5, 2021 · 0 comments

Comments

@jack-madebysix
Copy link

We have a use case where we need to include svgs in our dist directory as well having them in the sprite file. but when we add a new rule in to our webpack.confg testing for the svg files, we seem to break the sprite plugin and the files that get added to our dist directory are also wrong.

below is the test I have tried in the webpack.config

{ test: /\.svg$/, -use: [ { loader: 'file-loader', options: { outputPath: 'svg/', name: '[name].[ext]' } }, 'img-loader' ] },

And here is an example of what we get when it is output in the new svg directory. I would have expected to see the same svg markup as the original file but instead see this:
module.exports = { id: "close", url: __webpack_public_path__ + "___9739d1ca957f0e55c0553dcacdf21d69___", width: 16.414, height: 16.414, viewBox: "0 0 16.414 16.414", toString: function () { return __webpack_public_path__ + "___9739d1ca957f0e55c0553dcacdf21d69___" }, backgroundSize: "___657efc23ebc898a291624eaa764d4312___ ___40cba686828fbbebb7d5266ca33e76a3___", backgroundPosition: "___50402744ea4f77ed712ca2723ac83742___ ___0c07d5f7516af4d6609144ff9ea68205___" }

Basically id like to know if there's a way of using your sprite plugin and using a file loader to output the svgs to both the sprite file and the svg directory?

@jack-madebysix jack-madebysix changed the title Issue when trying to use file loader as well as your plygin Issue when trying to use file loader as well as your plugin Jan 5, 2021
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