We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
bug reproduce procedure
<html> <body> <div>Hello svg</div> <script type="text/javascript" src="bundle.js"></script> </body> </html>
<svg xmlns="http://www.w3.org/2000/svg"><circle cx="10" cy="10" r="10" fill="#000"/></svg> 3. import svg file from main.js:
<svg xmlns="http://www.w3.org/2000/svg"><circle cx="10" cy="10" r="10" fill="#000"/></svg>
var img1 = document.createElement("img"); img1.src = require("./100.svg") document.body.appendChild(img1);
module.exports = { entry: './main.js', output: { filename: 'bundle.js' }, module: { loaders:[ {test: /\.svg/, loader: 'svg-url-loader?limit=10000'}, ] } };
limit is larger enough force loader make Data URLs other than external svg file,and install loader:
npm i svg-url-loader --save-dev
then run bundle and open main.html:
webpack
img is break link .but if limit=1 ,then OK.
and one more thing ,I find :
module.exports = "\"data:image/svg+xml;charset=utf8,
in last lines of bundle.js .I think \" is root cause .
\"
thank you for attention .
The text was updated successfully, but these errors were encountered:
Have you tried noquotes options? When true, it removes surrounding double quotes from resulting data urine string. See Readme for example.
noquotes
Sorry, something went wrong.
When limit=1 loader delegates to file-loader, so your svg will be treated as any other image.
limit=1
👍 it works
No branches or pull requests
bug reproduce procedure
<svg xmlns="http://www.w3.org/2000/svg"><circle cx="10" cy="10" r="10" fill="#000"/></svg>
3. import svg file from main.js:
limit is larger enough force loader make Data URLs other than external svg file,and install loader:
npm i svg-url-loader --save-dev
then run bundle and open main.html:
webpack
img is break link .but if limit=1 ,then OK.
and one more thing ,I find :
module.exports = "\"data:image/svg+xml;charset=utf8,
in last lines of bundle.js .I think
\"
is root cause .thank you for attention .
The text was updated successfully, but these errors were encountered: