Skip to content

experimental.css use @supports with env() will export invalid css #16155

@jerrykingxyz

Description

@jerrykingxyz

Bug report

What is the current behavior?

experimental.css use @supports with env() will export invalid css

If the current behavior is a bug, please provide the steps to reproduce.

const path = require("path");

module.exports = {
  entry: {
    main: path.resolve(__dirname, "src/index.js"),
  },
  output: {
    publicPath: "/",
    path: path.resolve(__dirname, "dist"),
    libraryTarget: "module",
  },
  experiments: {
    outputModule: true,
    css: true,
  },
};
// src/index.js
import "./index.css";
/* src/index.css */
@supports (top: env(safe-area-inset-top, 0)) {}

export css

@supports (top: env(safe-area-inset-top, 0 {}

head{--webpack-webpack_test-786:_271;}

What is the expected behavior?

Other relevant information:
webpack version: 5.74.0
Node.js version: v16.16.0
Operating System:
Additional tools:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions