diff --git a/.gitignore b/.gitignore index bc78f263784..78d24875a40 100644 --- a/.gitignore +++ b/.gitignore @@ -221,6 +221,8 @@ tests/webpack-test/**/dev-defaults.webpack.lock tests/plugin-test/css-extract/js !tests/plugin-test/css-extract/**/node_modules +tests/plugin-test/html-plugin/js + /webpack-examples/**/dist smoke-example diff --git a/.prettierignore b/.prettierignore index f4827610165..203645a95fc 100644 --- a/.prettierignore +++ b/.prettierignore @@ -13,9 +13,8 @@ packages/**/etc/**/* packages/rspack-test-tools/template/**/* packages/rspack-test-tools/src/helper/legacy/**/* packages/rspack-test-tools/tests/**/* -packages/rspack-plugin-mini-css-extract/test/cases/**/* crates/**/* target/**/* -tests/**/*.* +tests/**/* !tests/**/test.filter.js diff --git a/biome.jsonc b/biome.jsonc index b201eaf8d51..b2908ab3e6f 100644 --- a/biome.jsonc +++ b/biome.jsonc @@ -19,7 +19,6 @@ "packages/rspack-test-tools/template/**/*", "packages/rspack-test-tools/tests/**/*", "packages/rspack-test-tools/src/helper/legacy/**/*", - "packages/rspack-plugin-mini-css-extract/test/cases/**/*", "packages/playground/**/*", // --- ignore runtime code in browser "packages/rspack/hot", diff --git a/crates/rspack_plugin_html/src/visitors/asset.rs b/crates/rspack_plugin_html/src/visitors/asset.rs index 79044ade299..d517f0ac5a8 100644 --- a/crates/rspack_plugin_html/src/visitors/asset.rs +++ b/crates/rspack_plugin_html/src/visitors/asset.rs @@ -45,10 +45,7 @@ impl HTMLPluginTag { append_to: HtmlInject, script_loading: &HtmlScriptLoading, ) -> HTMLPluginTag { - let mut attributes = vec![HtmlPluginAttribute { - attr_name: "src".to_string(), - attr_value: Some(src.to_string()), - }]; + let mut attributes = vec![]; match script_loading { HtmlScriptLoading::Defer => { attributes.push(HtmlPluginAttribute { @@ -65,6 +62,11 @@ impl HTMLPluginTag { _ => {} } + attributes.push(HtmlPluginAttribute { + attr_name: "src".to_string(), + attr_value: Some(src.to_string()), + }); + HTMLPluginTag { tag_name: "script".to_string(), append_to, diff --git a/package.json b/package.json index f2f52956a33..1377fd41e11 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "x": "zx x.mjs", "dev": "pnpm --filter @rspack/cli run dev", "clean": "pnpm --filter @rspack/cli run clean", - "check-dependency-version": "check-dependency-version-consistency . --ignore-dep typescript --ignore-dep @napi-rs/cli --ignore-dep chalk --ignore-package webpack-test --ignore-package webpack-examples", + "check-dependency-version": "check-dependency-version-consistency . --ignore-dep typescript --ignore-dep @napi-rs/cli --ignore-dep chalk --ignore-package webpack-test --ignore-package webpack-examples --ignore-package plugin-test", "build:js": "pnpm --filter \"@rspack/core\" build:force && pnpm --filter \"@rspack/*\" --filter \"!@rspack/core\" build", "build:cli:debug": "npm run build:binding:debug && npm run build:js", "build:cli:release": "npm run build:binding:release && npm run build:js", diff --git a/packages/rspack-test-tools/tests/builtinCases/plugin-html/basic/__snapshots__/output.snap.txt b/packages/rspack-test-tools/tests/builtinCases/plugin-html/basic/__snapshots__/output.snap.txt index c78204f54c7..7ecc6b569cd 100644 --- a/packages/rspack-test-tools/tests/builtinCases/plugin-html/basic/__snapshots__/output.snap.txt +++ b/packages/rspack-test-tools/tests/builtinCases/plugin-html/basic/__snapshots__/output.snap.txt @@ -4,7 +4,7 @@