zeratul1

Results 4 comments of zeratul1

> 2、使用 [@charset](https://developer.mozilla.org/zh-cn/docs/web/css/@charset),不过这种方法我试了好久vue-cli编译后的css都没能把@charset ”UTF-8“输出,直接使用sass命令行编译是有的 https://github.com/webpack-contrib/sass-loader/blob/0db6fb61416052ad750383efb829e2c42a75a238/src/utils.js#L150-L153 https://github.com/sass/dart-sass/blob/ec0bab5538e6c6913c1f074f08d59ba6eb9bc3f6/lib/src/visitor/serialize.dart#L44-L79 因为 sass-loader 会检查运行环境的模式,给 dart-sass 传入 `{ outputStyle: "compressed" }`。 dart-sass 在这时会使用 BOM 而不是输出 `@charset`。 如果是通过 @vue/cli 搭建的环境,因为有 cssnano 处理压缩,所以可以给 vue.config.js 传入 sassOptions 避免 compressed。...

@szmetro2019 可以。 在构建产生的 css 文件里第一行就会有 `@charset`

Please check this PR #37

https://github.com/Silind-Software/direflow/blob/990016cf1569f628f7771729ffbb3cac31f52014/packages/direflow-scripts/src/config/config-overrides.ts#L122 The `sourceMap` option was only configured as `true` in `development` environment, so we got an empty souce map file after build.