diff --git a/crates/pack-core/src/shared/webpack_rules/less.rs b/crates/pack-core/src/shared/webpack_rules/less.rs index 4e2c1f595..3c8630cc3 100644 --- a/crates/pack-core/src/shared/webpack_rules/less.rs +++ b/crates/pack-core/src/shared/webpack_rules/less.rs @@ -46,8 +46,8 @@ pub async fn get_less_loader_rules( let mut rules = Vec::new(); for (pattern, rename) in [ - (rcstr!("*.module.less"), rcstr!(".module.css")), - (rcstr!("*.less"), rcstr!(".css")), + (rcstr!("*.module.less"), rcstr!("*.module.css")), + (rcstr!("*.less"), rcstr!("*.css")), ] { rules.push(( pattern, diff --git a/crates/pack-tests/tests/snapshot/style/css_modules/output/crates_pack-tests_tests_snapshot_style_css_modules_input_a4667d8f.js b/crates/pack-tests/tests/snapshot/style/css_modules/output/crates_pack-tests_tests_snapshot_style_css_modules_input_a4667d8f.js index da803d8c7..fc292a8ce 100644 --- a/crates/pack-tests/tests/snapshot/style/css_modules/output/crates_pack-tests_tests_snapshot_style_css_modules_input_a4667d8f.js +++ b/crates/pack-tests/tests/snapshot/style/css_modules/output/crates_pack-tests_tests_snapshot_style_css_modules_input_a4667d8f.js @@ -9,7 +9,7 @@ __turbopack_context__.v({ 415, ((__turbopack_context__) => { __turbopack_context__.v({ - "button": "-css?modules__uw1sgq__button", + "button": "style-less__Ha9uLq__button", }); }), 197, ((__turbopack_context__) => { @@ -40,7 +40,7 @@ __turbopack_context__.v({ 49, ((__turbopack_context__) => { __turbopack_context__.v({ - "button": "-module__PBs03G__button", + "button": "style-module-less-module__n1Cx1q__button", }); }), 565, ((__turbopack_context__) => { diff --git a/crates/pack-tests/tests/snapshot/style/css_modules/output/crates_pack-tests_tests_snapshot_style_css_modules_input_a4667d8f.js.map b/crates/pack-tests/tests/snapshot/style/css_modules/output/crates_pack-tests_tests_snapshot_style_css_modules_input_a4667d8f.js.map index c4ce7a8d9..8f7d07cf4 100644 --- a/crates/pack-tests/tests/snapshot/style/css_modules/output/crates_pack-tests_tests_snapshot_style_css_modules_input_a4667d8f.js.map +++ b/crates/pack-tests/tests/snapshot/style/css_modules/output/crates_pack-tests_tests_snapshot_style_css_modules_input_a4667d8f.js.map @@ -3,12 +3,12 @@ "sources": [], "sections": [ {"offset": {"line": 3, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/crates/pack-tests/tests/snapshot/style/css_modules/input/auto_css_modules/style1.css?modules [client] (css module)"],"sourcesContent":["__turbopack_context__.v({\n \"container\": \"style1__tEp8Ja__container\",\n \"title\": \"style1__tEp8Ja__title\",\n});\n"],"names":[],"mappings":"AAAA;AACA;AACA;AACA"}}, - {"offset": {"line": 10, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/crates/pack-tests/tests/snapshot/style/css_modules/input/auto_css_modules/style.less?modules [client] (css module)"],"sourcesContent":["__turbopack_context__.v({\n \"button\": \"-css?modules__uw1sgq__button\",\n});\n"],"names":[],"mappings":"AAAA;AACA;AACA"}}, + {"offset": {"line": 10, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/crates/pack-tests/tests/snapshot/style/css_modules/input/auto_css_modules/style.less?modules [client] (css module)"],"sourcesContent":["__turbopack_context__.v({\n \"button\": \"style-less__Ha9uLq__button\",\n});\n"],"names":[],"mappings":"AAAA;AACA;AACA"}}, {"offset": {"line": 16, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/crates/pack-tests/tests/snapshot/style/css_modules/input/auto_css_modules/style.sass?modules [client] (css module)"],"sourcesContent":["__turbopack_context__.v({\n \"card\": \"style-sass__YRuz8a__card\",\n});\n"],"names":[],"mappings":"AAAA;AACA;AACA"}}, {"offset": {"line": 22, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/crates/pack-tests/tests/snapshot/style/css_modules/input/auto_css_modules/style.scss.css?modules [client] (css module)"],"sourcesContent":["__turbopack_context__.v({\n \"header\": \"style-scss__ijVZ3q__header\",\n});\n"],"names":[],"mappings":"AAAA;AACA;AACA"}}, {"offset": {"line": 28, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/crates/pack-tests/tests/snapshot/style/css_modules/input/auto_css_modules/style2.css?modules [client] (css module)"],"sourcesContent":["__turbopack_context__.v({\n \"existing\": \"style2__XU2cva__existing\",\n});\n"],"names":[],"mappings":"AAAA;AACA;AACA"}}, {"offset": {"line": 34, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/crates/pack-tests/tests/snapshot/style/css_modules/input/normal_css_modules/style.module.css [client] (css module)"],"sourcesContent":["__turbopack_context__.v({\n \"container\": \"style-module__otGYcG__container\",\n \"title\": \"style-module__otGYcG__title\",\n});\n"],"names":[],"mappings":"AAAA;AACA;AACA;AACA"}}, - {"offset": {"line": 41, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/crates/pack-tests/tests/snapshot/style/css_modules/input/normal_css_modules/style.module.less [client] (css module)"],"sourcesContent":["__turbopack_context__.v({\n \"button\": \"-module__PBs03G__button\",\n});\n"],"names":[],"mappings":"AAAA;AACA;AACA"}}, + {"offset": {"line": 41, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/crates/pack-tests/tests/snapshot/style/css_modules/input/normal_css_modules/style.module.less [client] (css module)"],"sourcesContent":["__turbopack_context__.v({\n \"button\": \"style-module-less-module__n1Cx1q__button\",\n});\n"],"names":[],"mappings":"AAAA;AACA;AACA"}}, {"offset": {"line": 47, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/crates/pack-tests/tests/snapshot/style/css_modules/input/normal_css_modules/style.module.sass [client] (css module)"],"sourcesContent":["__turbopack_context__.v({\n \"card\": \"style-module-sass-module__qgbigG__card\",\n});\n"],"names":[],"mappings":"AAAA;AACA;AACA"}}, {"offset": {"line": 53, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/crates/pack-tests/tests/snapshot/style/css_modules/input/normal_css_modules/style.module.scss [client] (css module)"],"sourcesContent":["__turbopack_context__.v({\n \"header\": \"style-module-scss-module__nX14Vq__header\",\n});\n"],"names":[],"mappings":"AAAA;AACA;AACA"}}, {"offset": {"line": 60, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/crates/pack-tests/tests/snapshot/style/css_modules/input/index.ts"],"sourcesContent":["// auto css modules\n\nimport styles from './auto_css_modules/style1.css';\nimport lessStyles from './auto_css_modules/style.less';\nimport sassStyles from './auto_css_modules/style.sass';\nimport scssStyles from './auto_css_modules/style.scss';\n\nconsole.log('CSS styles:', styles);\nconsole.log('LESS styles:', lessStyles);\nconsole.log('SASS styles:', sassStyles);\nconsole.log('SCSS styles:', scssStyles);\n\nimport existingModules from './auto_css_modules/style2.css?modules';\nconsole.log('Existing modules:', existingModules); \n\n\n// normal css modules\nimport styles2 from './normal_css_modules/style.module.css';\nimport lessStyle2 from './normal_css_modules/style.module.less';\nimport sassStyle2 from './normal_css_modules/style.module.sass';\nimport scssStyle2 from './normal_css_modules/style.module.scss';\n\nconsole.log('CSS styles2:', styles2);\nconsole.log('LESS styles2:', lessStyle2);\nconsole.log('SASS styles2:', sassStyle2);\nconsole.log('SCSS styles2:', scssStyle2);"],"names":[],"mappings":"AAAA,mBAAmB;;AAEnB;AACA;AACA;AACA;AAOA;AAIA,qBAAqB;AACrB;AACA;AACA;AACA;;;;;AAbA,QAAQ,GAAG,CAAC,eAAe,+CAAM;AACjC,QAAQ,GAAG,CAAC,gBAAgB,+CAAU;AACtC,QAAQ,GAAG,CAAC,gBAAgB,+CAAU;AACtC,QAAQ,GAAG,CAAC,gBAAgB,+CAAU;;AAGtC,QAAQ,GAAG,CAAC,qBAAqB,+CAAe;;;;;AAShD,QAAQ,GAAG,CAAC,gBAAgB,+CAAO;AACnC,QAAQ,GAAG,CAAC,iBAAiB,8CAAU;AACvC,QAAQ,GAAG,CAAC,iBAAiB,+CAAU;AACvC,QAAQ,GAAG,CAAC,iBAAiB,+CAAU"}}] diff --git a/crates/pack-tests/tests/snapshot/style/css_modules/output/_1cf48903.css b/crates/pack-tests/tests/snapshot/style/css_modules/output/crates_pack-tests_tests_snapshot_style_css_modules_input_db4c60c6.css similarity index 82% rename from crates/pack-tests/tests/snapshot/style/css_modules/output/_1cf48903.css rename to crates/pack-tests/tests/snapshot/style/css_modules/output/crates_pack-tests_tests_snapshot_style_css_modules_input_db4c60c6.css index fb0fc4d03..040fa4e0d 100644 --- a/crates/pack-tests/tests/snapshot/style/css_modules/output/_1cf48903.css +++ b/crates/pack-tests/tests/snapshot/style/css_modules/output/crates_pack-tests_tests_snapshot_style_css_modules_input_db4c60c6.css @@ -9,8 +9,8 @@ font-size: 24px; } -/* [project]/.css?modules [client] (css) */ -.-css\?modules__uw1sgq__button { +/* [project]/crates/pack-tests/tests/snapshot/style/css_modules/input/auto_css_modules/style.less.css?modules [client] (css) */ +.style-less__Ha9uLq__button { color: #fff; background-color: #007bff; border: none; @@ -51,8 +51,8 @@ font-size: 24px; } -/* [project]/.module.css [client] (css) */ -.-module__PBs03G__button { +/* [project]/crates/pack-tests/tests/snapshot/style/css_modules/input/normal_css_modules/style.module.less.module.css [client] (css) */ +.style-module-less-module__n1Cx1q__button { color: #fff; background-color: #007bff; border: none; @@ -76,4 +76,4 @@ background-color: #1e7e34; } -/*# sourceMappingURL=_1cf48903.css.map*/ \ No newline at end of file +/*# sourceMappingURL=crates_pack-tests_tests_snapshot_style_css_modules_input_db4c60c6.css.map*/ \ No newline at end of file diff --git a/crates/pack-tests/tests/snapshot/style/css_modules/output/_1cf48903.css.map b/crates/pack-tests/tests/snapshot/style/css_modules/output/crates_pack-tests_tests_snapshot_style_css_modules_input_db4c60c6.css.map similarity index 100% rename from crates/pack-tests/tests/snapshot/style/css_modules/output/_1cf48903.css.map rename to crates/pack-tests/tests/snapshot/style/css_modules/output/crates_pack-tests_tests_snapshot_style_css_modules_input_db4c60c6.css.map diff --git a/crates/pack-tests/tests/snapshot/style/css_modules/output/main.js b/crates/pack-tests/tests/snapshot/style/css_modules/output/main.js index 9564c4589..ab8125424 100644 --- a/crates/pack-tests/tests/snapshot/style/css_modules/output/main.js +++ b/crates/pack-tests/tests/snapshot/style/css_modules/output/main.js @@ -1,5 +1,5 @@ (globalThis.TURBOPACK || (globalThis.TURBOPACK = [])).push([ typeof document === "object" ? document.currentScript : undefined, - {"otherChunks":["_1cf48903.css","crates_pack-tests_tests_snapshot_style_css_modules_input_a4667d8f.js"],"runtimeModuleIds":[818]} + {"otherChunks":["crates_pack-tests_tests_snapshot_style_css_modules_input_db4c60c6.css","crates_pack-tests_tests_snapshot_style_css_modules_input_a4667d8f.js"],"runtimeModuleIds":[818]} ]); // Dummy runtime diff --git a/next.js b/next.js index 8d8592eb5..b2f409ddf 160000 --- a/next.js +++ b/next.js @@ -1 +1 @@ -Subproject commit 8d8592eb5ff0f94ed7b1e8b34ed38d970958b201 +Subproject commit b2f409ddf14dc3bfe167145730a8a0d7a39d13d2