Unverified Commit 92e84f4d authored by Donny/강동윤's avatar Donny/강동윤 Committed by GitHub

feat(turbopack): Minify CSS files while building (#71130)

### What?

Enable minification of CSS when building for production.

### Why?

It's generally required.
parent 37643810
......@@ -322,6 +322,7 @@ pub async fn get_client_module_options_context(
enable_mdx_rs,
css: CssOptionsContext {
use_swc_css,
minify_type: next_mode.minify_type(),
..module_options_context.css
},
rules: vec![
......
......@@ -47,25 +47,13 @@ describe.each([
if (process.env.TURBOPACK) {
if (dependencies.sass) {
expect(cssContentWithoutSourceMap).toMatchInlineSnapshot(`
".redText ::placeholder {
color: red;
}
.flex-parsing {
flex: 0 0 calc(50% - var(--vertical-gutter));
}"
`)
expect(cssContentWithoutSourceMap).toMatchInlineSnapshot(
`".redText ::placeholder{color:red}.flex-parsing{flex:0 0 calc(50% - var(--vertical-gutter))}"`
)
} else {
expect(cssContentWithoutSourceMap).toMatchInlineSnapshot(`
".redText ::placeholder {
color: red;
}
.flex-parsing {
flex: 0 0 calc(50% - var(--vertical-gutter));
}"
`)
expect(cssContentWithoutSourceMap).toMatchInlineSnapshot(
`".redText ::placeholder{color:red}.flex-parsing{flex:0 0 calc(50% - var(--vertical-gutter))}"`
)
}
} else {
if (dependencies.sass) {
......@@ -103,7 +91,7 @@ describe.each([
"sections": [
{
"map": {
"mappings": "AAAA;;;;AAAiC",
"mappings": "AAAA,iCAAiC",
"names": [],
"sources": [
"turbopack://[project]/styles/global.scss.css",
......@@ -126,8 +114,8 @@ describe.each([
"version": 3,
},
"offset": {
"column": 0,
"line": 8,
"column": 91,
"line": 1,
},
},
],
......@@ -140,7 +128,7 @@ describe.each([
"sections": [
{
"map": {
"mappings": "AAAA;;;;AAAiC",
"mappings": "AAAA,iCAAiC",
"names": [],
"sources": [
"turbopack://[project]/styles/global.scss.css",
......@@ -163,8 +151,8 @@ describe.each([
"version": 3,
},
"offset": {
"column": 0,
"line": 8,
"column": 91,
"line": 1,
},
},
],
......
......@@ -101,12 +101,9 @@ describe('CSS Modules: Import Global CSS', () => {
.trim()
if (process.env.TURBOPACK) {
expect(cssContent.replace(/\/\*.*?\*\//g, '').trim())
.toMatchInlineSnapshot(`
"a .foo {
all: initial;
}"
`)
expect(
cssContent.replace(/\/\*.*?\*\//g, '').trim()
).toMatchInlineSnapshot(`"a .foo{all:initial}"`)
} else {
expect(
cssContent.replace(/\/\*.*?\*\//g, '').trim()
......
......@@ -52,16 +52,9 @@ describe('Custom Properties: Pass-Through IE11', () => {
.trim()
if (process.env.TURBOPACK) {
expect(cssContent.replace(/\/\*.*?\*\//g, '').trim())
.toMatchInlineSnapshot(`
":root {
--color: red;
}
h1 {
color: var(--color);
}"
`)
expect(
cssContent.replace(/\/\*.*?\*\//g, '').trim()
).toMatchInlineSnapshot(`":root{--color:red}h1{color:var(--color)}"`)
} else {
expect(
cssContent.replace(/\/\*.*?\*\//g, '').trim()
......@@ -109,16 +102,9 @@ describe('Custom Properties: Pass-Through Modern', () => {
.trim()
if (process.env.TURBOPACK) {
expect(cssContent.replace(/\/\*.*?\*\//g, '').trim())
.toMatchInlineSnapshot(`
":root {
--color: red;
}
h1 {
color: var(--color);
}"
`)
expect(
cssContent.replace(/\/\*.*?\*\//g, '').trim()
).toMatchInlineSnapshot(`":root{--color:red}h1{color:var(--color)}"`)
} else {
expect(
cssContent.replace(/\/\*.*?\*\//g, '').trim()
......
......@@ -59,12 +59,9 @@ describe('Basic CSS Module Support', () => {
)
if (process.env.TURBOPACK) {
expect(cssContent.replace(/\/\*.*?\*\//g, '').trim())
.toMatchInlineSnapshot(`
".index-module__VJHdSq__redText {
color: red;
}"
`)
expect(
cssContent.replace(/\/\*.*?\*\//g, '').trim()
).toMatchInlineSnapshot(`".index-module__VJHdSq__redText{color:red}"`)
} else {
expect(
cssContent.replace(/\/\*.*?\*\//g, '').trim()
......@@ -137,25 +134,11 @@ describe('3rd Party CSS Module Support', () => {
res.text()
)
if (process.env.TURBOPACK) {
expect(cssContent.replace(/\/\*.*?\*\//g, '').trim())
.toMatchInlineSnapshot(`
".index-module__jAE1EW__foo {
position: relative;
}
.index-module__jAE1EW__foo .bar, .index-module__jAE1EW__foo .baz {
height: 100%;
overflow: hidden;
}
.index-module__jAE1EW__foo .lol {
width: 80%;
}
.index-module__jAE1EW__foo > .lel {
width: 80%;
}"
`)
expect(
cssContent.replace(/\/\*.*?\*\//g, '').trim()
).toMatchInlineSnapshot(
`".index-module__jAE1EW__foo{position:relative}.index-module__jAE1EW__foo .bar,.index-module__jAE1EW__foo .baz{height:100%;overflow:hidden}.index-module__jAE1EW__foo .lol{width:80%}.index-module__jAE1EW__foo>.lel{width:80%}"`
)
} else {
expect(
cssContent.replace(/\/\*.*?\*\//g, '').trim()
......@@ -416,12 +399,9 @@ describe('Valid CSS Module Usage from within node_modules', () => {
)
if (process.env.TURBOPACK) {
expect(cssContent.replace(/\/\*.*?\*\//g, '').trim())
.toMatchInlineSnapshot(`
".index-module__kwuKnq__redText {
color: red;
}"
`)
expect(
cssContent.replace(/\/\*.*?\*\//g, '').trim()
).toMatchInlineSnapshot(`".index-module__kwuKnq__redText{color:red}"`)
} else {
expect(
cssContent.replace(/\/\*.*?\*\//g, '').trim()
......@@ -539,17 +519,11 @@ describe('CSS Module Composes Usage (Basic)', () => {
)
if (process.env.TURBOPACK) {
expect(cssContent.replace(/\/\*.*?\*\//g, '').trim())
.toMatchInlineSnapshot(`
".index-module__QppuLW__className {
background: red;
color: #ff0;
}
.index-module__QppuLW__subClass {
background: #00f;
}"
`)
expect(
cssContent.replace(/\/\*.*?\*\//g, '').trim()
).toMatchInlineSnapshot(
`".index-module__QppuLW__className{background:red;color:#ff0}.index-module__QppuLW__subClass{background:#00f;}"`
)
} else {
expect(
cssContent.replace(/\/\*.*?\*\//g, '').trim()
......@@ -666,12 +640,11 @@ describe('Dynamic Route CSS Module Usage', () => {
res.text()
)
if (process.env.TURBOPACK) {
expect(cssContent.replace(/\/\*.*?\*\//g, '').trim())
.toMatchInlineSnapshot(`
".index-module__Iury9a__home {
background: red;
}"
`)
expect(
cssContent.replace(/\/\*.*?\*\//g, '').trim()
).toMatchInlineSnapshot(
`".index-module__Iury9a__home{background:red}"`
)
} else {
expect(
cssContent.replace(/\/\*.*?\*\//g, '').trim()
......@@ -735,15 +708,10 @@ describe('Catch-all Route CSS Module Usage', () => {
if (process.env.TURBOPACK) {
expect(cssContent.replace(/\/\*.*?\*\//g, '').trim())
.toMatchInlineSnapshot(`
".index-module___rV4CG__home {
background: red;
}
".index-module___rV4CG__home{background:red}
.\\35 5css-module__qe774W__home {
color: green;
}"
.\\35 5css-module__qe774W__home{color:green}"
`)
} else {
expect(
......
......@@ -67,17 +67,9 @@ module.exports = {
.trim()
if (process.env.TURBOPACK && useLightningcss) {
expect(cssContent).toMatchInlineSnapshot(`
".red-text {
color: red;
}"
`)
expect(cssContent).toMatchInlineSnapshot(`".red-text{color:red}"`)
} else if (process.env.TURBOPACK && !useLightningcss) {
expect(cssContent).toMatchInlineSnapshot(`
".red-text {
color: red;
}"
`)
expect(cssContent).toMatchInlineSnapshot(`".red-text{color:red}"`)
} else if (useLightningcss) {
expect(cssContent).toMatchInlineSnapshot(`".red-text{color:red}"`)
} else {
......@@ -146,17 +138,9 @@ module.exports = {
.trim()
if (process.env.TURBOPACK && useLightningcss) {
expect(cssContent).toMatchInlineSnapshot(`
".red-text {
color: red;
}"
`)
expect(cssContent).toMatchInlineSnapshot(`".red-text{color:red}"`)
} else if (process.env.TURBOPACK && !useLightningcss) {
expect(cssContent).toMatchInlineSnapshot(`
".red-text {
color: red;
}"
`)
expect(cssContent).toMatchInlineSnapshot(`".red-text{color:red}"`)
} else if (useLightningcss) {
expect(cssContent).toMatchInlineSnapshot(`".red-text{color:red}"`)
} else {
......@@ -220,17 +204,9 @@ module.exports = {
.trim()
if (process.env.TURBOPACK && useLightningcss) {
expect(cssContent).toMatchInlineSnapshot(`
".red-text {
color: red;
}"
`)
expect(cssContent).toMatchInlineSnapshot(`".red-text{color:red}"`)
} else if (process.env.TURBOPACK && !useLightningcss) {
expect(cssContent).toMatchInlineSnapshot(`
".red-text {
color: red;
}"
`)
expect(cssContent).toMatchInlineSnapshot(`".red-text{color:red}"`)
} else if (useLightningcss) {
expect(cssContent).toMatchInlineSnapshot(`".red-text{color:red}"`)
} else {
......@@ -296,28 +272,18 @@ module.exports = {
if (process.env.TURBOPACK && useLightningcss) {
expect(cssContent).toMatchInlineSnapshot(`
".red-text {
color: red;
}
".red-text{color:red}
.blue-text {
color: #00f;
}"
`)
.blue-text{color:#00f}"
`)
} else if (process.env.TURBOPACK && !useLightningcss) {
expect(cssContent).toMatchInlineSnapshot(`
".red-text {
color: red;
}
".red-text{color:red}
.blue-text {
color: #00f;
}"
`)
.blue-text{color:#00f}"
`)
} else if (useLightningcss) {
expect(cssContent).toMatchInlineSnapshot(
`".red-text{color:red}.blue-text{color:#00f}"`
......@@ -387,56 +353,30 @@ module.exports = {
if (process.env.TURBOPACK && useLightningcss) {
expect(cssContent).toMatchInlineSnapshot(`
".red-text {
color: purple;
font-weight: bolder;
}
".red-text{color:purple;font-weight:bolder}
.red-text {
color: red;
}
.red-text{color:red}
.blue-text{color:orange;font-weight:bolder}
.blue-text {
color: orange;
font-weight: bolder;
}
.blue-text {
color: #00f;
}"
`)
.blue-text{color:#00f}"
`)
} else if (process.env.TURBOPACK && !useLightningcss) {
expect(cssContent).toMatchInlineSnapshot(`
".red-text {
color: purple;
font-weight: bolder;
}
".red-text{color:purple;font-weight:bolder}
.red-text {
color: red;
}
.red-text{color:red}
.blue-text {
color: orange;
font-weight: bolder;
}
.blue-text{color:orange;font-weight:bolder}
.blue-text {
color: #00f;
}"
`)
.blue-text{color:#00f}"
`)
} else if (useLightningcss) {
expect(cssContent).toMatchInlineSnapshot(
`".red-text{color:purple;font-weight:bolder;color:red}.blue-text{color:orange;font-weight:bolder;color:#00f}"`
......@@ -507,28 +447,18 @@ module.exports = {
if (process.env.TURBOPACK && useLightningcss) {
expect(cssContent).toMatchInlineSnapshot(`
".blue-text {
color: #00f;
}
".blue-text{color:#00f}
.red-text {
color: red;
}"
`)
.red-text{color:red}"
`)
} else if (process.env.TURBOPACK && !useLightningcss) {
expect(cssContent).toMatchInlineSnapshot(`
".blue-text {
color: #00f;
}
".blue-text{color:#00f}
.red-text {
color: red;
}"
`)
.red-text{color:red}"
`)
} else if (useLightningcss) {
expect(cssContent).toMatchInlineSnapshot(
`".blue-text{color:#00f}.red-text{color:red}"`
......@@ -598,46 +528,24 @@ module.exports = {
if (process.env.TURBOPACK && useLightningcss) {
expect(cssContent).toMatchInlineSnapshot(`
".red-text {
color: red;
background-image: url("../media/dark.993bedd3.svg") url("../media/dark2.993bedd3.svg");
}
".red-text{color:red;background-image:url(../media/dark.993bedd3.svg) url(../media/dark2.993bedd3.svg)}
.blue-text {
color: orange;
font-weight: bolder;
background-image: url("../media/light.180573e4.svg");
}
.blue-text{color:orange;font-weight:bolder;background-image:url(../media/light.180573e4.svg)}
.blue-text {
color: #00f;
}"
`)
.blue-text{color:#00f}"
`)
} else if (process.env.TURBOPACK && !useLightningcss) {
expect(cssContent).toMatchInlineSnapshot(`
".red-text {
color: red;
background-image: url("../media/dark.993bedd3.svg") url("../media/dark2.993bedd3.svg");
}
".red-text{color:red;background-image:url(../media/dark.993bedd3.svg) url(../media/dark2.993bedd3.svg)}
.blue-text {
color: orange;
font-weight: bolder;
background-image: url("../media/light.180573e4.svg");
}
.blue-text{color:orange;font-weight:bolder;background-image:url(../media/light.180573e4.svg)}
.blue-text {
color: #00f;
}"
`)
.blue-text{color:#00f}"
`)
} else if (useLightningcss) {
expect(cssContent).toMatchInlineSnapshot(
`".red-text{color:red;background-image:url(/_next/static/media/dark.6b01655b.svg) url(/_next/static/media/dark2.6b01655b.svg)}.blue-text{color:orange;background-image:url(/_next/static/media/light.2da1d3d6.svg);font-weight:bolder;color:#00f}"`
......@@ -694,25 +602,14 @@ describe('CSS URL via `file-loader` and asset prefix (1)', () => {
if (process.env.TURBOPACK) {
expect(cssContent).toMatchInlineSnapshot(`
".red-text {
color: red;
background-image: url("../media/dark.993bedd3.svg") url("../media/dark2.993bedd3.svg");
}
".red-text{color:red;background-image:url(../media/dark.993bedd3.svg) url(../media/dark2.993bedd3.svg)}
.blue-text {
color: orange;
font-weight: bolder;
background-image: url("../media/light.180573e4.svg");
}
.blue-text{color:orange;font-weight:bolder;background-image:url(../media/light.180573e4.svg)}
.blue-text {
color: #00f;
}"
`)
.blue-text{color:#00f}"
`)
} else {
expect(cssContent).toMatchInlineSnapshot(
`".red-text{color:red;background-image:url(/foo/_next/static/media/dark.6b01655b.svg) url(/foo/_next/static/media/dark2.6b01655b.svg)}.blue-text{color:orange;font-weight:bolder;background-image:url(/foo/_next/static/media/light.2da1d3d6.svg);color:blue}"`
......@@ -762,25 +659,14 @@ describe('CSS URL via `file-loader` and asset prefix (2)', () => {
if (process.env.TURBOPACK) {
expect(cssContent).toMatchInlineSnapshot(`
".red-text {
color: red;
background-image: url("../media/dark.993bedd3.svg") url("../media/dark2.993bedd3.svg");
}
".red-text{color:red;background-image:url(../media/dark.993bedd3.svg) url(../media/dark2.993bedd3.svg)}
.blue-text {
color: orange;
font-weight: bolder;
background-image: url("../media/light.180573e4.svg");
}
.blue-text{color:orange;font-weight:bolder;background-image:url(../media/light.180573e4.svg)}
.blue-text {
color: #00f;
}"
`)
.blue-text{color:#00f}"
`)
} else {
expect(cssContent).toMatchInlineSnapshot(
`".red-text{color:red;background-image:url(/foo/_next/static/media/dark.6b01655b.svg) url(/foo/_next/static/media/dark2.6b01655b.svg)}.blue-text{color:orange;font-weight:bolder;background-image:url(/foo/_next/static/media/light.2da1d3d6.svg);color:blue}"`
......
......@@ -78,53 +78,13 @@ module.exports = {
.trim()
if (process.env.TURBOPACK && useLightningcss) {
expect(cssContentWithoutSourceMap).toMatchInlineSnapshot(`
"@media (480px <= width < 768px) {
::placeholder {
color: green;
}
}
.flex-parsing {
flex: 0 0 calc(50% - var(--vertical-gutter));
}
.transform-parsing {
transform: translate3d(0px, 0px);
}
.css-grid-shorthand {
grid-column: span 2;
}
.g-docs-sidenav .filter::-webkit-input-placeholder {
opacity: .8;
}"
`)
expect(cssContentWithoutSourceMap).toMatchInlineSnapshot(
`"@media (480px<=width<768px){::placeholder{color:green}}.flex-parsing{flex:0 0 calc(50% - var(--vertical-gutter))}.transform-parsing{transform:translate3d(0px,0px)}.css-grid-shorthand{grid-column:span 2}.g-docs-sidenav .filter::-webkit-input-placeholder{opacity:.8}"`
)
} else if (process.env.TURBOPACK && !useLightningcss) {
expect(cssContentWithoutSourceMap).toMatchInlineSnapshot(`
"@media (480px <= width < 768px) {
::placeholder {
color: green;
}
}
.flex-parsing {
flex: 0 0 calc(50% - var(--vertical-gutter));
}
.transform-parsing {
transform: translate3d(0px, 0px);
}
.css-grid-shorthand {
grid-column: span 2;
}
.g-docs-sidenav .filter::-webkit-input-placeholder {
opacity: .8;
}"
`)
expect(cssContentWithoutSourceMap).toMatchInlineSnapshot(
`"@media (480px<=width<768px){::placeholder{color:green}}.flex-parsing{flex:0 0 calc(50% - var(--vertical-gutter))}.transform-parsing{transform:translate3d(0px,0px)}.css-grid-shorthand{grid-column:span 2}.g-docs-sidenav .filter::-webkit-input-placeholder{opacity:.8}"`
)
} else if (useLightningcss) {
expect(cssContentWithoutSourceMap).toMatchInlineSnapshot(
`"@media (min-width:480px) and (max-width:767.999px){::placeholder{color:green}}.flex-parsing{flex:0 0 calc(50% - var(--vertical-gutter))}.transform-parsing{transform:translate3d(0,0)}.css-grid-shorthand{grid-column:span 2}.g-docs-sidenav .filter::-webkit-input-placeholder{opacity:.8}"`
......@@ -162,7 +122,7 @@ module.exports = {
"sections": [
{
"map": {
"mappings": "AAAA;EACE;;;;;AAKF;;;;AAIA;;;;AAIA;;;;AAIA",
"mappings": "AAAA,4BACE,2BAKF,0DAIA,kDAIA,uCAIA",
"names": [],
"sources": [
"turbopack://[project]/test/integration/css-fixtures/compilation-and-prefixing/styles/global.css",
......@@ -206,8 +166,8 @@ module.exports = {
"version": 3,
},
"offset": {
"column": 0,
"line": 22,
"column": 264,
"line": 1,
},
},
],
......@@ -220,7 +180,7 @@ module.exports = {
"sections": [
{
"map": {
"mappings": "AAAA;EACE;;;;;AAKF;;;;AAIA;;;;AAIA;;;;AAIA",
"mappings": "AAAA,4BACE,2BAKF,0DAIA,kDAIA,uCAIA",
"names": [],
"sources": [
"turbopack://[project]/test/integration/css-fixtures/compilation-and-prefixing/styles/global.css",
......@@ -264,8 +224,8 @@ module.exports = {
"version": 3,
},
"offset": {
"column": 0,
"line": 22,
"column": 264,
"line": 1,
},
},
],
......@@ -589,29 +549,19 @@ module.exports = {
if (process.env.TURBOPACK && useLightningcss) {
expect(cssContent.replace(/\/\*.*?\*\//g, '').trim())
.toMatchInlineSnapshot(`
".other {
color: #00f;
}
".other{color:#00f}
.test {
color: red;
}"
`)
.test{color:red}"
`)
} else if (process.env.TURBOPACK && !useLightningcss) {
expect(cssContent.replace(/\/\*.*?\*\//g, '').trim())
.toMatchInlineSnapshot(`
".other {
color: #00f;
}
".other{color:#00f}
.test {
color: red;
}"
`)
.test{color:red}"
`)
} else if (useLightningcss) {
expect(
cssContent.replace(/\/\*.*?\*\//g, '').trim()
......
......@@ -109,11 +109,7 @@ describe('Valid Global CSS from npm', () => {
.trim()
if (process.env.TURBOPACK) {
expect(cssContent).toMatchInlineSnapshot(`
".red-text {
color: "red";
}"
`)
expect(cssContent).toMatchInlineSnapshot(`".red-text{color:"red"}"`)
} else {
expect(cssContent).toMatchInlineSnapshot(`".red-text{color:"red"}"`)
}
......
......@@ -3,7 +3,7 @@ use turbo_tasks::{RcStr, TryJoinIterExt, ValueToString, Vc};
use turbo_tasks_fs::FileSystemPath;
use turbopack_core::{
asset::{Asset, AssetContent},
chunk::{ChunkItem, ChunkType, ChunkableModule, ChunkingContext},
chunk::{ChunkItem, ChunkType, ChunkableModule, ChunkingContext, MinifyType},
context::AssetContext,
ident::AssetIdent,
module::Module,
......@@ -40,6 +40,7 @@ pub struct CssModuleAsset {
asset_context: Vc<Box<dyn AssetContext>>,
import_context: Option<Vc<ImportContext>>,
ty: CssModuleAssetType,
minify_type: MinifyType,
use_swc_css: bool,
}
......@@ -51,6 +52,7 @@ impl CssModuleAsset {
source: Vc<Box<dyn Source>>,
asset_context: Vc<Box<dyn AssetContext>>,
ty: CssModuleAssetType,
minify_type: MinifyType,
use_swc_css: bool,
import_context: Option<Vc<ImportContext>>,
) -> Vc<Self> {
......@@ -59,6 +61,7 @@ impl CssModuleAsset {
asset_context,
import_context,
ty,
minify_type,
use_swc_css,
})
}
......@@ -100,10 +103,11 @@ impl ProcessCss for CssModuleAsset {
fn finalize_css(
self: Vc<Self>,
chunking_context: Vc<Box<dyn ChunkingContext>>,
minify_type: MinifyType,
) -> Vc<FinalCssResult> {
let process_result = self.get_css_with_placeholder();
finalize_css(process_result, chunking_context)
finalize_css(process_result, chunking_context, minify_type)
}
}
......@@ -281,7 +285,10 @@ impl CssChunkItem for CssModuleChunkItem {
}
}
let result = self.module.finalize_css(chunking_context).await?;
let result = self
.module
.finalize_css(chunking_context, self.module.await?.minify_type)
.await?;
if let FinalCssResult::Ok {
output_code,
......
......@@ -27,7 +27,10 @@ use swc_core::{
ForgivingRelativeSelector, PseudoClassSelectorChildren, PseudoElementSelectorChildren,
RelativeSelector, SubclassSelector, TypeSelector, UrlValue,
},
codegen::{writer::basic::BasicCssWriter, CodeGenerator},
codegen::{
writer::basic::{BasicCssWriter, BasicCssWriterConfig},
CodeGenerator,
},
modules::{CssClassName, TransformConfig},
visit::{VisitMut, VisitMutWith, VisitWith},
},
......@@ -37,7 +40,7 @@ use turbo_tasks::{RcStr, ValueToString, Vc};
use turbo_tasks_fs::{FileContent, FileSystemPath};
use turbopack_core::{
asset::{Asset, AssetContent},
chunk::ChunkingContext,
chunk::{ChunkingContext, MinifyType},
issue::{
Issue, IssueExt, IssueSource, IssueStage, OptionIssueSource, OptionStyledString,
StyledString,
......@@ -111,6 +114,7 @@ impl StyleSheetLike<'_, '_> {
&self,
cm: Arc<swc_core::common::SourceMap>,
code: &str,
minify_type: MinifyType,
enable_srcmap: bool,
remove_imports: bool,
handle_nesting: bool,
......@@ -123,17 +127,19 @@ impl StyleSheetLike<'_, '_> {
None
};
let targets = if handle_nesting {
Targets {
include: Features::Nesting,
..Default::default()
}
} else {
Default::default()
};
let result = ss.to_css(PrinterOptions {
minify: false,
minify: matches!(minify_type, MinifyType::Minify),
source_map: srcmap.as_mut(),
targets: if handle_nesting {
Targets {
include: Features::Nesting,
..Default::default()
}
} else {
Default::default()
},
targets,
analyze_dependencies: None,
..Default::default()
})?;
......@@ -247,8 +253,21 @@ impl StyleSheetLike<'_, '_> {
let mut srcmap = if enable_srcmap { Some(vec![]) } else { None };
let mut code_gen = CodeGenerator::new(
BasicCssWriter::new(&mut code_string, srcmap.as_mut(), Default::default()),
Default::default(),
BasicCssWriter::new(
&mut code_string,
srcmap.as_mut(),
if matches!(minify_type, MinifyType::Minify) {
BasicCssWriterConfig {
indent_width: 0,
..Default::default()
}
} else {
Default::default()
},
),
swc_core::css::codegen::CodegenConfig {
minify: matches!(minify_type, MinifyType::Minify),
},
);
code_gen.emit(&stylesheet)?;
......@@ -360,7 +379,8 @@ pub async fn process_css_with_placeholder(
_ => bail!("this case should be filtered out while parsing"),
};
let (result, _) = stylesheet.to_css(cm.clone(), &code, false, false, false)?;
let (result, _) =
stylesheet.to_css(cm.clone(), &code, MinifyType::NoMinify, false, false, false)?;
let exports = result.exports.map(|exports| {
let mut exports = exports.into_iter().collect::<IndexMap<_, _>>();
......@@ -389,6 +409,7 @@ pub async fn process_css_with_placeholder(
pub async fn finalize_css(
result: Vc<CssWithPlaceholderResult>,
chunking_context: Vc<Box<dyn ChunkingContext>>,
minify_type: MinifyType,
) -> Result<Vc<FinalCssResult>> {
let result = result.await?;
match &*result {
......@@ -427,7 +448,8 @@ pub async fn finalize_css(
FileContent::Content(v) => v.content().to_str()?,
_ => bail!("this case should be filtered out while parsing"),
};
let (result, srcmap) = stylesheet.to_css(cm.clone(), &code, true, true, true)?;
let (result, srcmap) =
stylesheet.to_css(cm.clone(), &code, minify_type, true, true, true)?;
Ok(FinalCssResult::Ok {
output_code: result.code,
......@@ -453,6 +475,7 @@ pub trait ProcessCss: ParseCss {
async fn finalize_css(
self: Vc<Self>,
chunking_context: Vc<Box<dyn ChunkingContext>>,
minify_type: MinifyType,
) -> Result<Vc<FinalCssResult>>;
}
......
/* [project]/turbopack/crates/turbopack-tests/tests/snapshot/css/absolute-uri-import/input/withduplicateurl.css [test] (css, ) */
.bar {
background-color: green;
}
.bar{background-color:green}
/*# sourceMappingURL=4c35f_tests_snapshot_css_absolute-uri-import_input_withduplicateurl_d96429.css.map*/
\ No newline at end of file
......@@ -3,5 +3,5 @@
"sources": [],
"sections": [
{"offset": {"line": 1, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/absolute-uri-import/input/withduplicateurl.css"],"sourcesContent":["/* This should not be duplicated */\n@import \"https://example.com/stylesheet1.css\";\n\n.bar {\n background-color:green;\n}\n"],"names":[],"mappings":"AAGA"}},
{"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}]
{"offset": {"line": 1, "column": 28}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}]
}
\ No newline at end of file
......@@ -2,21 +2,12 @@
@import "https://example.com/withquote\".css";
@import "https://example.com/stylesheet2.css";
/* [project]/turbopack/crates/turbopack-tests/tests/snapshot/css/absolute-uri-import/input/other.css [test] (css, ) */
.foo {
background-color: red;
}
.foo{background-color:red}
/* [project]/turbopack/crates/turbopack-tests/tests/snapshot/css/absolute-uri-import/input/withduplicateurl.css [test] (css, ) */
.bar {
background-color: green;
}
.bar{background-color:green}
/* [project]/turbopack/crates/turbopack-tests/tests/snapshot/css/absolute-uri-import/input/index.css [test] (css) */
body {
background-color: #00f;
}
body{background-color:#00f}
/*# sourceMappingURL=4e721_crates_turbopack-tests_tests_snapshot_css_absolute-uri-import_input_6d2a92._.css.map*/
\ No newline at end of file
......@@ -3,9 +3,9 @@
"sources": [],
"sections": [
{"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/absolute-uri-import/input/other.css"],"sourcesContent":[".foo {\n background-color: red;\n}\n"],"names":[],"mappings":"AAAA"}},
{"offset": {"line": 7, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}},
{"offset": {"line": 10, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/absolute-uri-import/input/withduplicateurl.css"],"sourcesContent":["/* This should not be duplicated */\n@import \"https://example.com/stylesheet1.css\";\n\n.bar {\n background-color:green;\n}\n"],"names":[],"mappings":"AAGA"}},
{"offset": {"line": 13, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}},
{"offset": {"line": 16, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/absolute-uri-import/input/index.css"],"sourcesContent":["@import \"https://example.com/stylesheet1.css\";\n@import \"https://example.com/withquote\\\".css\";\n@import \"./other.css\";\n@import \"./withduplicateurl.css\";\n@import url(\"https://example.com/stylesheet2.css\");\n\nbody {\n background-color: blue;\n}\n"],"names":[],"mappings":"AAMA"}},
{"offset": {"line": 19, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}]
{"offset": {"line": 4, "column": 26}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}},
{"offset": {"line": 7, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/absolute-uri-import/input/withduplicateurl.css"],"sourcesContent":["/* This should not be duplicated */\n@import \"https://example.com/stylesheet1.css\";\n\n.bar {\n background-color:green;\n}\n"],"names":[],"mappings":"AAGA"}},
{"offset": {"line": 7, "column": 28}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}},
{"offset": {"line": 10, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/absolute-uri-import/input/index.css"],"sourcesContent":["@import \"https://example.com/stylesheet1.css\";\n@import \"https://example.com/withquote\\\".css\";\n@import \"./other.css\";\n@import \"./withduplicateurl.css\";\n@import url(\"https://example.com/stylesheet2.css\");\n\nbody {\n background-color: blue;\n}\n"],"names":[],"mappings":"AAMA"}},
{"offset": {"line": 10, "column": 27}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}]
}
\ No newline at end of file
/* [project]/turbopack/crates/turbopack-tests/tests/snapshot/css/absolute-uri-import/input/index.css [test] (css) */
body {
background-color: #00f;
}
body{background-color:#00f}
/*# sourceMappingURL=b1abf_turbopack-tests_tests_snapshot_css_absolute-uri-import_input_index_7d7e1c.css.map*/
\ No newline at end of file
......@@ -3,5 +3,5 @@
"sources": [],
"sections": [
{"offset": {"line": 1, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/absolute-uri-import/input/index.css"],"sourcesContent":["@import \"https://example.com/stylesheet1.css\";\n@import \"https://example.com/withquote\\\".css\";\n@import \"./other.css\";\n@import \"./withduplicateurl.css\";\n@import url(\"https://example.com/stylesheet2.css\");\n\nbody {\n background-color: blue;\n}\n"],"names":[],"mappings":"AAMA"}},
{"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}]
{"offset": {"line": 1, "column": 27}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}]
}
\ No newline at end of file
/* [project]/turbopack/crates/turbopack-tests/tests/snapshot/css/absolute-uri-import/input/other.css [test] (css, ) */
.foo {
background-color: red;
}
.foo{background-color:red}
/*# sourceMappingURL=b1abf_turbopack-tests_tests_snapshot_css_absolute-uri-import_input_other_d96429.css.map*/
\ No newline at end of file
......@@ -3,5 +3,5 @@
"sources": [],
"sections": [
{"offset": {"line": 1, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/absolute-uri-import/input/other.css"],"sourcesContent":[".foo {\n background-color: red;\n}\n"],"names":[],"mappings":"AAAA"}},
{"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}]
{"offset": {"line": 1, "column": 26}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}]
}
\ No newline at end of file
......@@ -2,10 +2,7 @@
@layer layer.foo {
@media print and (orientation: landscape) {
@supports not(display: inline-grid) and font-format(woff2) {
.imported {
color: red;
}
.imported{color:red}
}
}
}
......@@ -14,10 +11,7 @@
@layer layer.bar {
@media print and (orientation: portrait) {
@supports not(display: inline-grid) and font-format(woff2) {
.imported {
color: red;
}
.imported{color:red}
}
}
}
......@@ -26,10 +20,7 @@
@layer layer {
@media print {
@supports not(display: inline-grid) and font-format(woff2) {
.imported {
color: orange;
}
.imported{color:orange}
}
}
}
......@@ -38,18 +29,12 @@
@layer layer {
@media print {
@supports not(display: inline-grid) {
.imported {
color: #0ff;
}
.imported{color:#0ff}
}
}
}
/* [project]/turbopack/crates/turbopack-tests/tests/snapshot/css/chained-attributes/input/style.css [test] (css) */
.style {
color: #ff0;
}
.style{color:#ff0}
/*# sourceMappingURL=4e721_crates_turbopack-tests_tests_snapshot_css_chained-attributes_input_0c8b85._.css.map*/
\ No newline at end of file
......@@ -3,13 +3,13 @@
"sources": [],
"sections": [
{"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/chained-attributes/input/c.css"],"sourcesContent":[".imported {\n color: red;\n}\n"],"names":[],"mappings":"AAAA"}},
{"offset": {"line": 7, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}},
{"offset": {"line": 16, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/chained-attributes/input/c.css"],"sourcesContent":[".imported {\n color: red;\n}\n"],"names":[],"mappings":"AAAA"}},
{"offset": {"line": 19, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}},
{"offset": {"line": 28, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/chained-attributes/input/b.css"],"sourcesContent":["@import url(\"./c.css\") layer(foo) (orientation: landscape);\n@import url(\"./c.css\") layer(bar) (orientation: portrait);\n\n.imported {\n color: orange;\n}\n"],"names":[],"mappings":"AAGA"}},
{"offset": {"line": 31, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}},
{"offset": {"line": 40, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/chained-attributes/input/a.css"],"sourcesContent":["@import url(\"./b.css\") supports(font-format(woff2));\n\n.imported {\n color: cyan;\n}\n"],"names":[],"mappings":"AAEA"}},
{"offset": {"line": 43, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}},
{"offset": {"line": 49, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/chained-attributes/input/style.css"],"sourcesContent":["@import url(\"./a.css\") layer(layer) supports(not(display: inline-grid)) print;\n\n.style {\n color: yellow;\n}\n"],"names":[],"mappings":"AAEA"}},
{"offset": {"line": 52, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}]
{"offset": {"line": 4, "column": 20}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}},
{"offset": {"line": 13, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/chained-attributes/input/c.css"],"sourcesContent":[".imported {\n color: red;\n}\n"],"names":[],"mappings":"AAAA"}},
{"offset": {"line": 13, "column": 20}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}},
{"offset": {"line": 22, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/chained-attributes/input/b.css"],"sourcesContent":["@import url(\"./c.css\") layer(foo) (orientation: landscape);\n@import url(\"./c.css\") layer(bar) (orientation: portrait);\n\n.imported {\n color: orange;\n}\n"],"names":[],"mappings":"AAGA"}},
{"offset": {"line": 22, "column": 23}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}},
{"offset": {"line": 31, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/chained-attributes/input/a.css"],"sourcesContent":["@import url(\"./b.css\") supports(font-format(woff2));\n\n.imported {\n color: cyan;\n}\n"],"names":[],"mappings":"AAEA"}},
{"offset": {"line": 31, "column": 21}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}},
{"offset": {"line": 37, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/chained-attributes/input/style.css"],"sourcesContent":["@import url(\"./a.css\") layer(layer) supports(not(display: inline-grid)) print;\n\n.style {\n color: yellow;\n}\n"],"names":[],"mappings":"AAEA"}},
{"offset": {"line": 37, "column": 18}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}]
}
\ No newline at end of file
......@@ -2,10 +2,7 @@
@layer layer {
@media print {
@supports not(display: inline-grid) {
.imported {
color: #0ff;
}
.imported{color:#0ff}
}
}
}
......
......@@ -3,5 +3,5 @@
"sources": [],
"sections": [
{"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/chained-attributes/input/a.css"],"sourcesContent":["@import url(\"./b.css\") supports(font-format(woff2));\n\n.imported {\n color: cyan;\n}\n"],"names":[],"mappings":"AAEA"}},
{"offset": {"line": 7, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}]
{"offset": {"line": 4, "column": 21}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}]
}
\ No newline at end of file
......@@ -2,10 +2,7 @@
@layer layer {
@media print {
@supports not(display: inline-grid) and font-format(woff2) {
.imported {
color: orange;
}
.imported{color:orange}
}
}
}
......
......@@ -3,5 +3,5 @@
"sources": [],
"sections": [
{"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/chained-attributes/input/b.css"],"sourcesContent":["@import url(\"./c.css\") layer(foo) (orientation: landscape);\n@import url(\"./c.css\") layer(bar) (orientation: portrait);\n\n.imported {\n color: orange;\n}\n"],"names":[],"mappings":"AAGA"}},
{"offset": {"line": 7, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}]
{"offset": {"line": 4, "column": 23}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}]
}
\ No newline at end of file
......@@ -2,10 +2,7 @@
@layer layer.bar {
@media print and (orientation: portrait) {
@supports not(display: inline-grid) and font-format(woff2) {
.imported {
color: red;
}
.imported{color:red}
}
}
}
......
......@@ -3,5 +3,5 @@
"sources": [],
"sections": [
{"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/chained-attributes/input/c.css"],"sourcesContent":[".imported {\n color: red;\n}\n"],"names":[],"mappings":"AAAA"}},
{"offset": {"line": 7, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}]
{"offset": {"line": 4, "column": 20}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}]
}
\ No newline at end of file
......@@ -2,10 +2,7 @@
@layer layer.foo {
@media print and (orientation: landscape) {
@supports not(display: inline-grid) and font-format(woff2) {
.imported {
color: red;
}
.imported{color:red}
}
}
}
......
......@@ -3,5 +3,5 @@
"sources": [],
"sections": [
{"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/chained-attributes/input/c.css"],"sourcesContent":[".imported {\n color: red;\n}\n"],"names":[],"mappings":"AAAA"}},
{"offset": {"line": 7, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}]
{"offset": {"line": 4, "column": 20}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}]
}
\ No newline at end of file
/* [project]/turbopack/crates/turbopack-tests/tests/snapshot/css/chained-attributes/input/style.css [test] (css) */
.style {
color: #ff0;
}
.style{color:#ff0}
/*# sourceMappingURL=4e721_crates_turbopack-tests_tests_snapshot_css_chained-attributes_input_style_7d7e1c.css.map*/
\ No newline at end of file
......@@ -3,5 +3,5 @@
"sources": [],
"sections": [
{"offset": {"line": 1, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/chained-attributes/input/style.css"],"sourcesContent":["@import url(\"./a.css\") layer(layer) supports(not(display: inline-grid)) print;\n\n.style {\n color: yellow;\n}\n"],"names":[],"mappings":"AAEA"}},
{"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}]
{"offset": {"line": 1, "column": 18}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}]
}
\ No newline at end of file
/* [project]/turbopack/crates/turbopack-tests/tests/snapshot/css/css-legacy-nesting/input/style.css [test] (css) */
.prose :where(table):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
text-wrap: initial;
}
.prose :where(table):not(:where([class~="not-prose"], [class~="not-prose"] *)) tr td:first-child {
text-wrap: nowrap;
}
.prose :where(code):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
text-wrap: nowrap;
}
.prose :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){text-wrap:initial}.prose :where(table):not(:where([class~=not-prose],[class~=not-prose] *)) tr td:first-child{text-wrap:nowrap}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){text-wrap:nowrap}
/*# sourceMappingURL=4e721_crates_turbopack-tests_tests_snapshot_css_css-legacy-nesting_input_style_7d7e1c.css.map*/
\ No newline at end of file
......@@ -2,6 +2,6 @@
"version": 3,
"sources": [],
"sections": [
{"offset": {"line": 1, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/css-legacy-nesting/input/style.css"],"sourcesContent":[".prose :where(table):not(:where([class~=\"not-prose\"], [class~=\"not-prose\"] *)) {\n tr {\n td:first-child {\n text-wrap: nowrap;\n }\n }\n text-wrap: initial;\n}\n\n.prose :where(code):not(:where([class~=\"not-prose\"], [class~=\"not-prose\"] *)) {\n text-wrap: nowrap;\n}\n"],"names":[],"mappings":"AAAA;;;;AAEI;;;;AAOJ"}},
{"offset": {"line": 12, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}]
{"offset": {"line": 1, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/css-legacy-nesting/input/style.css"],"sourcesContent":[".prose :where(table):not(:where([class~=\"not-prose\"], [class~=\"not-prose\"] *)) {\n tr {\n td:first-child {\n text-wrap: nowrap;\n }\n }\n text-wrap: initial;\n}\n\n.prose :where(code):not(:where([class~=\"not-prose\"], [class~=\"not-prose\"] *)) {\n text-wrap: nowrap;\n}\n"],"names":[],"mappings":"AAAA,4FAEI,6GAOJ"}},
{"offset": {"line": 1, "column": 291}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}]
}
\ No newline at end of file
/* [project]/turbopack/crates/turbopack-tests/tests/snapshot/css/css-legacy-nesting/input/style.css [test] (css) */
.prose :where(table):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
text-wrap: initial;
}
.prose :where(table):not(:where([class~="not-prose"], [class~="not-prose"] *)) tr td:first-child {
text-wrap: nowrap;
}
.prose :where(code):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
text-wrap: nowrap;
}
.prose :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){text-wrap:initial}.prose :where(table):not(:where([class~=not-prose],[class~=not-prose] *)) tr td:first-child{text-wrap:nowrap}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){text-wrap:nowrap}
/*# sourceMappingURL=4e721_crates_turbopack-tests_tests_snapshot_css_css-legacy-nesting_input_style_da4646.css.map*/
\ No newline at end of file
......@@ -2,6 +2,6 @@
"version": 3,
"sources": [],
"sections": [
{"offset": {"line": 1, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/css-legacy-nesting/input/style.css"],"sourcesContent":[".prose :where(table):not(:where([class~=\"not-prose\"], [class~=\"not-prose\"] *)) {\n tr {\n td:first-child {\n text-wrap: nowrap;\n }\n }\n text-wrap: initial;\n}\n\n.prose :where(code):not(:where([class~=\"not-prose\"], [class~=\"not-prose\"] *)) {\n text-wrap: nowrap;\n}\n"],"names":[],"mappings":"AAAA;;;;AAEI;;;;AAOJ"}},
{"offset": {"line": 12, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}]
{"offset": {"line": 1, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/css-legacy-nesting/input/style.css"],"sourcesContent":[".prose :where(table):not(:where([class~=\"not-prose\"], [class~=\"not-prose\"] *)) {\n tr {\n td:first-child {\n text-wrap: nowrap;\n }\n }\n text-wrap: initial;\n}\n\n.prose :where(code):not(:where([class~=\"not-prose\"], [class~=\"not-prose\"] *)) {\n text-wrap: nowrap;\n}\n"],"names":[],"mappings":"AAAA,4FAEI,6GAOJ"}},
{"offset": {"line": 1, "column": 291}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}]
}
\ No newline at end of file
/* [project]/turbopack/crates/turbopack-tests/tests/snapshot/css/css-modules/input/style.module.css [test] (css) */
.style-module__cu3fEW__module-style {
grid-template-areas: "checkbox avatar content actions menu";
}
.style-module__cu3fEW__module-style{grid-template-areas:"checkbox avatar content actions menu"}
/*# sourceMappingURL=4e721_crates_turbopack-tests_tests_snapshot_css_css-modules_input_style_module_76a252.css.map*/
\ No newline at end of file
......@@ -3,5 +3,5 @@
"sources": [],
"sections": [
{"offset": {"line": 1, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/css-modules/input/style.module.css"],"sourcesContent":[".module-style {\n grid-template-areas: 'checkbox avatar content actions menu';\n}\n\n"],"names":[],"mappings":"AAAA"}},
{"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}]
{"offset": {"line": 1, "column": 95}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}]
}
\ No newline at end of file
/* [project]/turbopack/crates/turbopack-tests/tests/snapshot/css/css-modules/input/style.module.css [test] (css) */
.style-module__cu3fEW__module-style {
grid-template-areas: "checkbox avatar content actions menu";
}
.style-module__cu3fEW__module-style{grid-template-areas:"checkbox avatar content actions menu"}
/*# sourceMappingURL=4e721_crates_turbopack-tests_tests_snapshot_css_css-modules_input_style_module_7d7e1c.css.map*/
\ No newline at end of file
......@@ -3,5 +3,5 @@
"sources": [],
"sections": [
{"offset": {"line": 1, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/css-modules/input/style.module.css"],"sourcesContent":[".module-style {\n grid-template-areas: 'checkbox avatar content actions menu';\n}\n\n"],"names":[],"mappings":"AAAA"}},
{"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}]
{"offset": {"line": 1, "column": 95}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}]
}
\ No newline at end of file
/* [project]/turbopack/crates/turbopack-tests/tests/snapshot/css/css/input/node_modules/foo/style.css [test] (css) */
.foo-style {
color: green;
}
.foo-style{color:green}
/*# sourceMappingURL=08d19_foo_style_7d7e1c.css.map*/
\ No newline at end of file
......@@ -3,5 +3,5 @@
"sources": [],
"sections": [
{"offset": {"line": 1, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/css/input/node_modules/foo/style.css"],"sourcesContent":[".foo-style { color: green; }\n"],"names":[],"mappings":"AAAA"}},
{"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}]
{"offset": {"line": 1, "column": 23}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}]
}
\ No newline at end of file
/* [project]/turbopack/crates/turbopack-tests/tests/snapshot/css/css/input/node_modules/foo/style.module.css [test] (css) */
.style-module__CEkn7G__foo-module-style {
color: #00f;
}
.style-module__CEkn7G__foo-module-style{color:#00f}
/*# sourceMappingURL=08d19_foo_style_module_7d7e1c.css.map*/
\ No newline at end of file
......@@ -3,5 +3,5 @@
"sources": [],
"sections": [
{"offset": {"line": 1, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/css/input/node_modules/foo/style.module.css"],"sourcesContent":[".foo-module-style { color: blue; }\n"],"names":[],"mappings":"AAAA"}},
{"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}]
{"offset": {"line": 1, "column": 51}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}]
}
\ No newline at end of file
/* [project]/turbopack/crates/turbopack-tests/tests/snapshot/css/css/input/style.module.css [test] (css) */
.style-module__Iu_hLa__module-style {
color: #f0f;
}
.style-module__Iu_hLa__module-style > h1, .style-module__Iu_hLa__module-style + .style-module__Iu_hLa__inner {
background: purple;
}
.style-module__Iu_hLa__composed-module-style {
color: green;
}
.style-module__Iu_hLa__another-composed-module-style {
color: #ff0;
}
.style-module__Iu_hLa__module-style{color:#f0f}.style-module__Iu_hLa__module-style>h1,.style-module__Iu_hLa__module-style+.style-module__Iu_hLa__inner{background:purple}.style-module__Iu_hLa__composed-module-style{color:green;}.style-module__Iu_hLa__another-composed-module-style{color:#ff0;}
/*# sourceMappingURL=4e721_crates_turbopack-tests_tests_snapshot_css_css_input_style_module_7d7e1c.css.map*/
\ No newline at end of file
......@@ -2,6 +2,6 @@
"version": 3,
"sources": [],
"sections": [
{"offset": {"line": 1, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/css/input/style.module.css"],"sourcesContent":[".module-style {\n color: magenta;\n > h1,\n + .inner {\n background: purple;\n }\n}\n\n.composed-module-style {\n composes: foo-module-style from \"foo/style.module.css\";\n color: green;\n}\n\n.another-composed-module-style {\n composes: foo-module-style from \"foo/style.module.css\";\n color: yellow;\n}"],"names":[],"mappings":"AAAA;;;;AAEE;;;;AAMF;;;;AAKA"}},
{"offset": {"line": 16, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}]
{"offset": {"line": 1, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/css/input/style.module.css"],"sourcesContent":[".module-style {\n color: magenta;\n > h1,\n + .inner {\n background: purple;\n }\n}\n\n.composed-module-style {\n composes: foo-module-style from \"foo/style.module.css\";\n color: green;\n}\n\n.another-composed-module-style {\n composes: foo-module-style from \"foo/style.module.css\";\n color: yellow;\n}"],"names":[],"mappings":"AAAA,+CAEE,0HAMF,0DAKA"}},
{"offset": {"line": 1, "column": 292}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}]
}
\ No newline at end of file
/* [project]/turbopack/crates/turbopack-tests/tests/snapshot/css/css/input/node_modules/foo/style.css [test] (css) */
.foo-style {
color: green;
}
.foo-style{color:green}
/* [project]/turbopack/crates/turbopack-tests/tests/snapshot/css/css/input/imported.css [test] (css, ) */
.imported {
color: #0ff;
}
.imported{color:#0ff}
/* [project]/turbopack/crates/turbopack-tests/tests/snapshot/css/css/input/imported.css [test] (css, layer(layer) print) */
@layer layer {
@media print {
.imported {
color: #0ff;
}
.imported{color:#0ff}
}
}
/* [project]/turbopack/crates/turbopack-tests/tests/snapshot/css/css/input/style.css [test] (css) */
.style {
color: #ff0;
}
.style{color:#ff0}
/* [project]/turbopack/crates/turbopack-tests/tests/snapshot/css/css/input/node_modules/foo/style.module.css [test] (css) */
.style-module__CEkn7G__foo-module-style {
color: #00f;
}
.style-module__CEkn7G__foo-module-style{color:#00f}
/* [project]/turbopack/crates/turbopack-tests/tests/snapshot/css/css/input/style.module.css [test] (css) */
.style-module__Iu_hLa__module-style {
color: #f0f;
}
.style-module__Iu_hLa__module-style > h1, .style-module__Iu_hLa__module-style + .style-module__Iu_hLa__inner {
background: purple;
}
.style-module__Iu_hLa__composed-module-style {
color: green;
}
.style-module__Iu_hLa__another-composed-module-style {
color: #ff0;
}
.style-module__Iu_hLa__module-style{color:#f0f}.style-module__Iu_hLa__module-style>h1,.style-module__Iu_hLa__module-style+.style-module__Iu_hLa__inner{background:purple}.style-module__Iu_hLa__composed-module-style{color:green;}.style-module__Iu_hLa__another-composed-module-style{color:#ff0;}
/*# sourceMappingURL=turbopack_crates_turbopack-tests_tests_snapshot_css_css_input_8f45c3._.css.map*/
\ No newline at end of file
......@@ -3,15 +3,15 @@
"sources": [],
"sections": [
{"offset": {"line": 1, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/css/input/node_modules/foo/style.css"],"sourcesContent":[".foo-style { color: green; }\n"],"names":[],"mappings":"AAAA"}},
{"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}},
{"offset": {"line": 7, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/css/input/imported.css"],"sourcesContent":[".imported {\n color: cyan;\n}\n"],"names":[],"mappings":"AAAA"}},
{"offset": {"line": 10, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}},
{"offset": {"line": 15, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/css/input/imported.css"],"sourcesContent":[".imported {\n color: cyan;\n}\n"],"names":[],"mappings":"AAAA"}},
{"offset": {"line": 18, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}},
{"offset": {"line": 23, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/css/input/style.css"],"sourcesContent":["@import url(\"./imported.css\");\n/* De-duplicate similar imports */\n@import url(\"../input/imported.css\");\n/* But not if they have different attributes */\n@import url(\"./imported.css\") layer(layer) print;\n.style {\n color: yellow;\n}\n"],"names":[],"mappings":"AAKA"}},
{"offset": {"line": 26, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}},
{"offset": {"line": 29, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/css/input/node_modules/foo/style.module.css"],"sourcesContent":[".foo-module-style { color: blue; }\n"],"names":[],"mappings":"AAAA"}},
{"offset": {"line": 32, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}},
{"offset": {"line": 35, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/css/input/style.module.css"],"sourcesContent":[".module-style {\n color: magenta;\n > h1,\n + .inner {\n background: purple;\n }\n}\n\n.composed-module-style {\n composes: foo-module-style from \"foo/style.module.css\";\n color: green;\n}\n\n.another-composed-module-style {\n composes: foo-module-style from \"foo/style.module.css\";\n color: yellow;\n}"],"names":[],"mappings":"AAAA;;;;AAEE;;;;AAMF;;;;AAKA"}},
{"offset": {"line": 50, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}]
{"offset": {"line": 1, "column": 23}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}},
{"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/css/input/imported.css"],"sourcesContent":[".imported {\n color: cyan;\n}\n"],"names":[],"mappings":"AAAA"}},
{"offset": {"line": 4, "column": 21}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}},
{"offset": {"line": 9, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/css/input/imported.css"],"sourcesContent":[".imported {\n color: cyan;\n}\n"],"names":[],"mappings":"AAAA"}},
{"offset": {"line": 9, "column": 21}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}},
{"offset": {"line": 14, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/css/input/style.css"],"sourcesContent":["@import url(\"./imported.css\");\n/* De-duplicate similar imports */\n@import url(\"../input/imported.css\");\n/* But not if they have different attributes */\n@import url(\"./imported.css\") layer(layer) print;\n.style {\n color: yellow;\n}\n"],"names":[],"mappings":"AAKA"}},
{"offset": {"line": 14, "column": 18}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}},
{"offset": {"line": 17, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/css/input/node_modules/foo/style.module.css"],"sourcesContent":[".foo-module-style { color: blue; }\n"],"names":[],"mappings":"AAAA"}},
{"offset": {"line": 17, "column": 51}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}},
{"offset": {"line": 20, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/css/input/style.module.css"],"sourcesContent":[".module-style {\n color: magenta;\n > h1,\n + .inner {\n background: purple;\n }\n}\n\n.composed-module-style {\n composes: foo-module-style from \"foo/style.module.css\";\n color: green;\n}\n\n.another-composed-module-style {\n composes: foo-module-style from \"foo/style.module.css\";\n color: yellow;\n}"],"names":[],"mappings":"AAAA,+CAEE,0HAMF,0DAKA"}},
{"offset": {"line": 20, "column": 292}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}]
}
\ No newline at end of file
/* [project]/turbopack/crates/turbopack-tests/tests/snapshot/css/css/input/imported.css [test] (css, layer(layer) print) */
@layer layer {
@media print {
.imported {
color: #0ff;
}
.imported{color:#0ff}
}
}
/*# sourceMappingURL=turbopack_crates_turbopack-tests_tests_snapshot_css_css_input_imported_9f97d9.css.map*/
\ No newline at end of file
......@@ -3,5 +3,5 @@
"sources": [],
"sections": [
{"offset": {"line": 3, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/css/input/imported.css"],"sourcesContent":[".imported {\n color: cyan;\n}\n"],"names":[],"mappings":"AAAA"}},
{"offset": {"line": 6, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}]
{"offset": {"line": 3, "column": 21}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}]
}
\ No newline at end of file
/* [project]/turbopack/crates/turbopack-tests/tests/snapshot/css/css/input/imported.css [test] (css, ) */
.imported {
color: #0ff;
}
.imported{color:#0ff}
/*# sourceMappingURL=turbopack_crates_turbopack-tests_tests_snapshot_css_css_input_imported_d96429.css.map*/
\ No newline at end of file
......@@ -3,5 +3,5 @@
"sources": [],
"sections": [
{"offset": {"line": 1, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/css/input/imported.css"],"sourcesContent":[".imported {\n color: cyan;\n}\n"],"names":[],"mappings":"AAAA"}},
{"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}]
{"offset": {"line": 1, "column": 21}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}]
}
\ No newline at end of file
/* [project]/turbopack/crates/turbopack-tests/tests/snapshot/css/css/input/style.css [test] (css) */
.style {
color: #ff0;
}
.style{color:#ff0}
/*# sourceMappingURL=turbopack_crates_turbopack-tests_tests_snapshot_css_css_input_style_7d7e1c.css.map*/
\ No newline at end of file
......@@ -3,5 +3,5 @@
"sources": [],
"sections": [
{"offset": {"line": 1, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/css/input/style.css"],"sourcesContent":["@import url(\"./imported.css\");\n/* De-duplicate similar imports */\n@import url(\"../input/imported.css\");\n/* But not if they have different attributes */\n@import url(\"./imported.css\") layer(layer) print;\n.style {\n color: yellow;\n}\n"],"names":[],"mappings":"AAKA"}},
{"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}]
{"offset": {"line": 1, "column": 18}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}]
}
\ No newline at end of file
/* [project]/turbopack/crates/turbopack-tests/tests/snapshot/css/relative-uri-import/input/another.css [test] (css, ) */
.bar {
background-color: green;
}
.bar{background-color:green}
/* [project]/turbopack/crates/turbopack-tests/tests/snapshot/css/relative-uri-import/input/other.css [test] (css, ) */
.foo {
background-color: red;
}
.foo{background-color:red}
/* [project]/turbopack/crates/turbopack-tests/tests/snapshot/css/relative-uri-import/input/index.css [test] (css) */
body {
background-color: #00f;
}
body{background-color:#00f}
/*# sourceMappingURL=4e721_crates_turbopack-tests_tests_snapshot_css_relative-uri-import_input_32f7a1._.css.map*/
\ No newline at end of file
......@@ -3,9 +3,9 @@
"sources": [],
"sections": [
{"offset": {"line": 1, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/relative-uri-import/input/another.css"],"sourcesContent":[".bar {\n background-color: green;\n}\n"],"names":[],"mappings":"AAAA"}},
{"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}},
{"offset": {"line": 7, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/relative-uri-import/input/other.css"],"sourcesContent":["@import \"another.css\";\n\n.foo {\n background-color: red;\n}\n"],"names":[],"mappings":"AAEA"}},
{"offset": {"line": 10, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}},
{"offset": {"line": 13, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/relative-uri-import/input/index.css"],"sourcesContent":["@import \"other.css\";\n\nbody {\n background-color: blue;\n}\n"],"names":[],"mappings":"AAEA"}},
{"offset": {"line": 16, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}]
{"offset": {"line": 1, "column": 28}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}},
{"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/relative-uri-import/input/other.css"],"sourcesContent":["@import \"another.css\";\n\n.foo {\n background-color: red;\n}\n"],"names":[],"mappings":"AAEA"}},
{"offset": {"line": 4, "column": 26}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}},
{"offset": {"line": 7, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/relative-uri-import/input/index.css"],"sourcesContent":["@import \"other.css\";\n\nbody {\n background-color: blue;\n}\n"],"names":[],"mappings":"AAEA"}},
{"offset": {"line": 7, "column": 27}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}]
}
\ No newline at end of file
/* [project]/turbopack/crates/turbopack-tests/tests/snapshot/css/relative-uri-import/input/another.css [test] (css, ) */
.bar {
background-color: green;
}
.bar{background-color:green}
/*# sourceMappingURL=b1abf_turbopack-tests_tests_snapshot_css_relative-uri-import_input_another_d96429.css.map*/
\ No newline at end of file
......@@ -3,5 +3,5 @@
"sources": [],
"sections": [
{"offset": {"line": 1, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/relative-uri-import/input/another.css"],"sourcesContent":[".bar {\n background-color: green;\n}\n"],"names":[],"mappings":"AAAA"}},
{"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}]
{"offset": {"line": 1, "column": 28}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}]
}
\ No newline at end of file
/* [project]/turbopack/crates/turbopack-tests/tests/snapshot/css/relative-uri-import/input/index.css [test] (css) */
body {
background-color: #00f;
}
body{background-color:#00f}
/*# sourceMappingURL=b1abf_turbopack-tests_tests_snapshot_css_relative-uri-import_input_index_7d7e1c.css.map*/
\ No newline at end of file
......@@ -3,5 +3,5 @@
"sources": [],
"sections": [
{"offset": {"line": 1, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/relative-uri-import/input/index.css"],"sourcesContent":["@import \"other.css\";\n\nbody {\n background-color: blue;\n}\n"],"names":[],"mappings":"AAEA"}},
{"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}]
{"offset": {"line": 1, "column": 27}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}]
}
\ No newline at end of file
/* [project]/turbopack/crates/turbopack-tests/tests/snapshot/css/relative-uri-import/input/other.css [test] (css, ) */
.foo {
background-color: red;
}
.foo{background-color:red}
/*# sourceMappingURL=b1abf_turbopack-tests_tests_snapshot_css_relative-uri-import_input_other_d96429.css.map*/
\ No newline at end of file
......@@ -3,5 +3,5 @@
"sources": [],
"sections": [
{"offset": {"line": 1, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/relative-uri-import/input/other.css"],"sourcesContent":["@import \"another.css\";\n\n.foo {\n background-color: red;\n}\n"],"names":[],"mappings":"AAEA"}},
{"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}]
{"offset": {"line": 1, "column": 26}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}]
}
\ No newline at end of file
/* [project]/turbopack/crates/turbopack-tests/tests/snapshot/css/url-in-supports-query/input/style.css [test] (swc css) */
@supports ((-webkit-mask: url("")) or (mask: url(""))) {
.supports-url-in-query {
color: red;
}
}
@supports((-webkit-mask:url(""))or (mask:url(""))){.supports-url-in-query{color:red}}
/*# sourceMappingURL=b1abf_turbopack-tests_tests_snapshot_css_url-in-supports-query_input_style_0d54ef.css.map*/
\ No newline at end of file
......@@ -2,6 +2,6 @@
"version": 3,
"sources": [],
"sections": [
{"offset": {"line": 1, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/url-in-supports-query/input/style.css"],"sourcesContent":["@supports ((-webkit-mask: url(\"\")) or (mask: url(\"\"))) {\n .supports-url-in-query {\n color: red;\n }\n}\n"],"names":[],"mappings":"AAAA,CAAC,QAAQ,CAAE,CAAC,CAAC,AAAD,YAAY,EAAE,GAAG,CAAC,EAAE,CAAA,CAAC,IAAM,CAAC,AAAD,IAAI,EAAE,GAAG,CAAC,EAAE,CAAA,CAAC,CAAC,CAAE,CAAC;EACtD,CAAC,qBAAqB,CAAC,CAAC;IACtB,KAAK,EAAE,GAAG;EACZ,CAAC;AACH,CAAC"}},
{"offset": {"line": 5, "column": 1}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}]
{"offset": {"line": 1, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/url-in-supports-query/input/style.css"],"sourcesContent":["@supports ((-webkit-mask: url(\"\")) or (mask: url(\"\"))) {\n .supports-url-in-query {\n color: red;\n }\n}\n"],"names":[],"mappings":"AAAA,CAAC,QAAQ,AAAE,CAAC,CAAC,AAAD,YAAY,CAAE,GAAG,CAAC,EAAE,CAAA,CAAC,GAAM,CAAC,AAAD,IAAI,CAAE,GAAG,CAAC,EAAE,CAAA,CAAC,CAAC,AAAE,CAAC,AACtD,CAAC,qBAAqB,AAAC,CAAC,AACtB,KAAK,CAAE,GAAG,AACZ,CAAC,AACH,CAAC"}},
{"offset": {"line": 1, "column": 85}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}]
}
\ No newline at end of file
/* [project]/turbopack/crates/turbopack-tests/tests/snapshot/css/url-in-supports-query/input/style.css [test] (swc css) */
@supports ((-webkit-mask: url("")) or (mask: url(""))) {
.supports-url-in-query {
color: red;
}
}
@supports((-webkit-mask:url(""))or (mask:url(""))){.supports-url-in-query{color:red}}
/*# sourceMappingURL=b1abf_turbopack-tests_tests_snapshot_css_url-in-supports-query_input_style_4b6496.css.map*/
\ No newline at end of file
......@@ -2,6 +2,6 @@
"version": 3,
"sources": [],
"sections": [
{"offset": {"line": 1, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/url-in-supports-query/input/style.css"],"sourcesContent":["@supports ((-webkit-mask: url(\"\")) or (mask: url(\"\"))) {\n .supports-url-in-query {\n color: red;\n }\n}\n"],"names":[],"mappings":"AAAA,CAAC,QAAQ,CAAE,CAAC,CAAC,AAAD,YAAY,EAAE,GAAG,CAAC,EAAE,CAAA,CAAC,IAAM,CAAC,AAAD,IAAI,EAAE,GAAG,CAAC,EAAE,CAAA,CAAC,CAAC,CAAE,CAAC;EACtD,CAAC,qBAAqB,CAAC,CAAC;IACtB,KAAK,EAAE,GAAG;EACZ,CAAC;AACH,CAAC"}},
{"offset": {"line": 5, "column": 1}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}]
{"offset": {"line": 1, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/url-in-supports-query/input/style.css"],"sourcesContent":["@supports ((-webkit-mask: url(\"\")) or (mask: url(\"\"))) {\n .supports-url-in-query {\n color: red;\n }\n}\n"],"names":[],"mappings":"AAAA,CAAC,QAAQ,AAAE,CAAC,CAAC,AAAD,YAAY,CAAE,GAAG,CAAC,EAAE,CAAA,CAAC,GAAM,CAAC,AAAD,IAAI,CAAE,GAAG,CAAC,EAAE,CAAA,CAAC,CAAC,AAAE,CAAC,AACtD,CAAC,qBAAqB,AAAC,CAAC,AACtB,KAAK,CAAE,GAAG,AACZ,CAAC,AACH,CAAC"}},
{"offset": {"line": 1, "column": 85}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}]
}
\ No newline at end of file
/* [project]/turbopack/crates/turbopack-tests/tests/snapshot/cssmodules/composes/input/index.module.css [test] (css) */
.index-module__H6xp9G__className {
background: red;
color: #ff0;
}
.index-module__H6xp9G__subClass {
background: #00f;
}
.index-module__H6xp9G__className{background:red;color:#ff0}.index-module__H6xp9G__subClass{background:#00f;}
/*# sourceMappingURL=b1abf_turbopack-tests_tests_snapshot_cssmodules_composes_input_index_module_226602.css.map*/
\ No newline at end of file
......@@ -2,6 +2,6 @@
"version": 3,
"sources": [],
"sections": [
{"offset": {"line": 1, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/cssmodules/composes/input/index.module.css"],"sourcesContent":[".className {\n background: red;\n color: yellow;\n}\n\n.subClass {\n composes: className;\n background: blue;\n}\n"],"names":[],"mappings":"AAAA;;;;;AAKA"}},
{"offset": {"line": 9, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}]
{"offset": {"line": 1, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/cssmodules/composes/input/index.module.css"],"sourcesContent":[".className {\n background: red;\n color: yellow;\n}\n\n.subClass {\n composes: className;\n background: blue;\n}\n"],"names":[],"mappings":"AAAA,2DAKA"}},
{"offset": {"line": 1, "column": 108}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}]
}
\ No newline at end of file
/* [project]/turbopack/crates/turbopack-tests/tests/snapshot/cssmodules/composes/input/index.module.css [test] (css) */
.index-module__H6xp9G__className {
background: red;
color: #ff0;
}
.index-module__H6xp9G__subClass {
background: #00f;
}
.index-module__H6xp9G__className{background:red;color:#ff0}.index-module__H6xp9G__subClass{background:#00f;}
/*# sourceMappingURL=b1abf_turbopack-tests_tests_snapshot_cssmodules_composes_input_index_module_7d7e1c.css.map*/
\ No newline at end of file
......@@ -2,6 +2,6 @@
"version": 3,
"sources": [],
"sections": [
{"offset": {"line": 1, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/cssmodules/composes/input/index.module.css"],"sourcesContent":[".className {\n background: red;\n color: yellow;\n}\n\n.subClass {\n composes: className;\n background: blue;\n}\n"],"names":[],"mappings":"AAAA;;;;;AAKA"}},
{"offset": {"line": 9, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}]
{"offset": {"line": 1, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/cssmodules/composes/input/index.module.css"],"sourcesContent":[".className {\n background: red;\n color: yellow;\n}\n\n.subClass {\n composes: className;\n background: blue;\n}\n"],"names":[],"mappings":"AAAA,2DAKA"}},
{"offset": {"line": 1, "column": 108}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}]
}
\ No newline at end of file
/* [project]/turbopack/crates/turbopack-tests/tests/snapshot/cssmodules/relative-uri-import/input/index.module.css [test] (css) */
.index-module__jZ0vmq__bar {
}
.index-module__jZ0vmq__bar{}
/*# sourceMappingURL=4c35f_tests_snapshot_cssmodules_relative-uri-import_input_index_module_7d7e1c.css.map*/
\ No newline at end of file
......@@ -3,5 +3,5 @@
"sources": [],
"sections": [
{"offset": {"line": 1, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/cssmodules/relative-uri-import/input/index.module.css"],"sourcesContent":[".bar {\n composes: foo from 'other.module.css';\n}\n"],"names":[],"mappings":"AAAA"}},
{"offset": {"line": 3, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}]
{"offset": {"line": 1, "column": 28}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}]
}
\ No newline at end of file
/* [project]/turbopack/crates/turbopack-tests/tests/snapshot/cssmodules/relative-uri-import/input/other.module.css [test] (css) */
.other-module__NjlEuq__foo {
background-color: red;
}
.other-module__NjlEuq__foo{background-color:red}
/*# sourceMappingURL=4c35f_tests_snapshot_cssmodules_relative-uri-import_input_other_module_7d7e1c.css.map*/
\ No newline at end of file
......@@ -3,5 +3,5 @@
"sources": [],
"sections": [
{"offset": {"line": 1, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/cssmodules/relative-uri-import/input/other.module.css"],"sourcesContent":[".foo {\n background-color: red;\n}\n"],"names":[],"mappings":"AAAA"}},
{"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}]
{"offset": {"line": 1, "column": 48}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}]
}
\ No newline at end of file
/* [project]/turbopack/crates/turbopack-tests/tests/snapshot/cssmodules/relative-uri-import/input/other.module.css [test] (css) */
.other-module__NjlEuq__foo {
background-color: red;
}
.other-module__NjlEuq__foo{background-color:red}
/* [project]/turbopack/crates/turbopack-tests/tests/snapshot/cssmodules/relative-uri-import/input/index.module.css [test] (css) */
.index-module__jZ0vmq__bar {
}
.index-module__jZ0vmq__bar{}
/*# sourceMappingURL=b1abf_turbopack-tests_tests_snapshot_cssmodules_relative-uri-import_input_5a7b6f._.css.map*/
\ No newline at end of file
......@@ -3,7 +3,7 @@
"sources": [],
"sections": [
{"offset": {"line": 1, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/cssmodules/relative-uri-import/input/other.module.css"],"sourcesContent":[".foo {\n background-color: red;\n}\n"],"names":[],"mappings":"AAAA"}},
{"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}},
{"offset": {"line": 7, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/cssmodules/relative-uri-import/input/index.module.css"],"sourcesContent":[".bar {\n composes: foo from 'other.module.css';\n}\n"],"names":[],"mappings":"AAAA"}},
{"offset": {"line": 9, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}]
{"offset": {"line": 1, "column": 48}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}},
{"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":["turbopack://[project]/turbopack/crates/turbopack-tests/tests/snapshot/cssmodules/relative-uri-import/input/index.module.css"],"sourcesContent":[".bar {\n composes: foo from 'other.module.css';\n}\n"],"names":[],"mappings":"AAAA"}},
{"offset": {"line": 4, "column": 28}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}]
}
\ No newline at end of file
......@@ -264,6 +264,11 @@ async fn apply_module_type(
source,
Vc::upcast(module_asset_context),
*ty,
module_asset_context
.module_options_context()
.await?
.css
.minify_type,
*use_swc_css,
if let ReferenceType::Css(CssReferenceSubType::AtImport(import)) =
reference_type.into_value()
......
......@@ -2,7 +2,8 @@ use indexmap::IndexMap;
use serde::{Deserialize, Serialize};
use turbo_tasks::{trace::TraceRawVcs, RcStr, ValueDefault, Vc};
use turbopack_core::{
condition::ContextCondition, environment::Environment, resolve::options::ImportMapping,
chunk::MinifyType, condition::ContextCondition, environment::Environment,
resolve::options::ImportMapping,
};
use turbopack_ecmascript::{references::esm::UrlRewriteBehavior, TreeShakingMode};
pub use turbopack_mdx::MdxTransformOptions;
......@@ -169,6 +170,8 @@ pub struct CssOptionsContext {
pub enable_raw_css: bool,
pub use_swc_css: bool,
pub minify_type: MinifyType,
pub placeholder_for_future_extensions: (),
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment