File tree Expand file tree Collapse file tree
test/configCases/css/minimize-is-namespace Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11795,12 +11795,14 @@ const _unwrapLoneIs = (parts) => {
1179511795 _isCompoundText(inner) &&
1179611796 !inner.includes("::") &&
1179711797 !_LEGACY_PSEUDO_ELEMENT_RE.test(inner) &&
11798- // A type or universal selector only leads a compound.
11798+ // A type or universal only leads a compound, and its namespace must
11799+ // not replace the default namespace constraining the outer compound.
1179911800 (!_startsTypeSelector(inner) ||
11800- before === -1 ||
11801- parts[before] === _SEP ||
11802- parts[before] === "," ||
11803- _isCombinator(parts[before].charCodeAt(0))) &&
11801+ (!inner.includes("|") &&
11802+ (before === -1 ||
11803+ parts[before] === _SEP ||
11804+ parts[before] === "," ||
11805+ _isCombinator(parts[before].charCodeAt(0))))) &&
1180411806 _pseudosReadable(inner)
1180511807 ) {
1180611808 parts[i] = "";
Original file line number Diff line number Diff line change 1+ // Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
2+
3+ exports [` ConfigCacheTestCases css minimize-is-namespace minimize-is-namespace should compile 1` ] = ` "@namespace url(http://www.w3.org/2000/svg);@namespace html url(http://www.w3.org/1999/xhtml);:is(*|*){ color :red } :is(html|*){ background - color :blue } :is(|*){ opacity :.5 } :is(*|rect){ fill :green } *|*:not(:is(*|*)){ border - width :1px } .safe{ stroke :blue } [lang|=en]{ stroke - width :2 } "` ;
Original file line number Diff line number Diff line change 1+ // Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
2+
3+ exports [` ConfigTestCases css minimize-is-namespace minimize-is-namespace should compile 1` ] = ` "@namespace url(http://www.w3.org/2000/svg);@namespace html url(http://www.w3.org/1999/xhtml);:is(*|*){ color :red } :is(html|*){ background - color :blue } :is(|*){ opacity :.5 } :is(*|rect){ fill :green } *|*:not(:is(*|*)){ border - width :1px } .safe{ stroke :blue } [lang|=en]{ stroke - width :2 } "` ;
Original file line number Diff line number Diff line change 1+ import stylesheet from "./style.css" ;
2+
3+ it ( "should emit the stylesheet with its namespace declarations" , ( ) => {
4+ expect ( stylesheet ) . toBe ( "style.css" ) ;
5+ } ) ;
Original file line number Diff line number Diff line change 1+ @namespace url ( http://www.w3.org/2000/svg) ;
2+ @namespace html url ( http://www.w3.org/1999/xhtml) ;
3+
4+ : is ( * |* ) {
5+ color : red;
6+ }
7+
8+ : is ( html |* ) {
9+ background-color : blue;
10+ }
11+
12+ : is ( |* ) {
13+ opacity : 0.5 ;
14+ }
15+
16+ : is ( * |rect ) {
17+ fill : green;
18+ }
19+
20+ * |* : not ( : is ( * |* ) ) {
21+ border-width : 1px ;
22+ }
23+
24+ : is ( . safe ) {
25+ stroke : blue;
26+ }
27+
28+ : is ( [lang |= en ]) {
29+ stroke-width : 2px ;
30+ }
Original file line number Diff line number Diff line change 1+ "use strict" ;
2+
3+ const fs = require ( "fs" ) ;
4+ const path = require ( "path" ) ;
5+
6+ module . exports = {
7+ afterExecute ( options ) {
8+ expect (
9+ fs . readFileSync ( path . join ( options . output . path , "style.css" ) , "utf8" )
10+ ) . toMatchSnapshot ( ) ;
11+ }
12+ } ;
Original file line number Diff line number Diff line change 1+ "use strict" ;
2+
3+ /** @type {import("../../../../").Configuration } */
4+ module . exports = {
5+ target : "web" ,
6+ mode : "production" ,
7+ output : {
8+ publicPath : "" ,
9+ assetModuleFilename : "[name][ext]"
10+ } ,
11+ module : {
12+ // Bundled CSS does not support @namespace; minify the standalone asset.
13+ rules : [ { test : / \. c s s $ / , type : "asset/resource" } ]
14+ } ,
15+ optimization : {
16+ minimize : { css : { extractComments : false } } ,
17+ minimizer : [ "..." ]
18+ } ,
19+ experiments : { css : true }
20+ } ;
You can’t perform that action at this time.
0 commit comments