svg-sprite-html-webpack:用于生成 SVG 精灵的 Webpack 加载器和插件元素并将其注入由 html-webpack-plugin 构建的 html 中

时间:2021-08-04 19:27:28
【文件属性】:
文件名称:svg-sprite-html-webpack:用于生成 SVG 精灵的 Webpack 加载器和插件元素并将其注入由 html-webpack-plugin 构建的 html 中
文件大小:90KB
文件格式:ZIP
更新时间:2021-08-04 19:27:28
JavaScript SVG sprite html webpack 加载器和插件 Webpack 加载器和插件,用于生成带有 元素的 SVG 精灵,并将其注入由 html-webpack-plugin 构建的 html 中 优点 : 在编译时注入精灵而不是浏览器运行时 svg 在没有其他加载器的情况下自动优化 为什么在 HTML 中注入 SVG sprite 而不是使用外部文件? 每次我们在 DOM 中注入一个元素 时,都会启动一个请求以获取“file.svg”。 所以图标出现延迟取决于http响应时间。 如果在 DOM 中注入 svg 符号时有动画,则该图标将出现在动画中间。 这个插件 + 加载器的目标是在 DOM 中注入符号引用时避免那些 http 请求。 安装 yarn add -D svg-sprite-ht
【文件预览】:
svg-sprite-html-webpack-master
----.gitignore(127B)
----.eslintrc(31B)
----package.json(924B)
----src()
--------loader.js(645B)
--------plugin.js(10KB)
--------spriteUtils.js(3KB)
----index.js(106B)
----README.md(5KB)
----test()
--------.eslintrc(67B)
--------plugin.test.js(4KB)
----.editorconfig(133B)
----yarn.lock(211KB)

网友评论