Skip to content

Minify css will transform rgba to #rrggbbaa #4650

Closed
@Ttou

Description

Describe the bug

use esbuild to minify css will transform rgba to #rrggbbaa,android webview can‘t support:#rrggbbaa

  • in vite.config.js set build.config.target with ['chrome61'] can't work
  • create build.js set target with ['chrome61'] can work

build.js

const esbuild = require('esbuild')

esbuild.buildSync({
  entryPoints: ['app.css'],
  minify: true,
  target: ['chrome61'],
  outfile: 'out.css'
})

Reproduction

#app {
  background-color: rgba(0, 0, 0, 0.1);
}
const esbuild = require('esbuild')

esbuild.buildSync({
  entryPoints: ['app.css'],
  minify: true,
  outfile: 'out.css'
})
#app{background-color:#0000001a}

System Info

System:
    OS: Windows 10 10.0.19043
    CPU: (12) x64 Intel(R) Core(TM) i5-10400 CPU @ 2.90GHz
    Memory: 9.96 GB / 15.84 GB
  Binaries:
    Node: 14.17.3 - C:\Program Files\nodejs\node.EXE
    npm: 6.14.13 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.19041.1023.0), Chromium (92.0.902.73)
    Internet Explorer: 11.0.19041.906
  npmPackages:
    vite: ^2.5.0 => 2.5.0

Used Package Manager

npm

Logs

No response

Validations

Metadata

Assignees

No one assigned

    Labels

    feat: cssp3-minor-bugAn edge case that only affects very specific usage (priority)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions