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
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
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?
The text was updated successfully, but these errors were encountered:
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
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?
The text was updated successfully, but these errors were encountered: