【发布时间】:2020-05-12 10:21:11
【问题描述】:
我在 Symfony 5 上创建了一个项目。当我运行“yarn build”时,我在 webpack 中收到一个错误。我试图从几天内修复它但没有成功,所以我决定寻求一些帮助:)
我在 webpack.config 中启用了 postCssLoader,并在我的根目录中创建了 posts.config.js
.enablePostCssLoader()
postss.config.js 文件
module.exports = {
plugins: [
require('autoprefixer'),
require('postcss-svgo'),
require('postcss-inline-svg'),
require('postcss-write-svg'),
]
}
这是我尝试在我的 css 中编写的 svg 示例
.custom-checkbox .custom-control-input:checked~.custom-control-label::after {
background-image: url('data:image/svg+xml,%3csvg xmlns=\'http://www.w3.org/2000/svg\' width=\'8\'
height=\'8\' viewBox=\'0 0 8 8\'%3e%3cpath fill=\'%23fff\' d=\'M6.564.75l-3.59 3.612-1.538-
1.55L0 4.26l2.974 2.99L8 2.193z\'/%3e%3c/svg%3e')
}
【问题讨论】:
-
请将错误提供为文本而不是图像,因为图像不可搜索。
标签: svg webpack node-modules yarnpkg loader