@crossbind/plugin-webpack 2.0.0-beta.60 → 2.0.0-beta.62

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +6 -0
  2. package/package.json +3 -3
package/index.js CHANGED
@@ -38,6 +38,12 @@ export default class CrossbindWebpackPlugin {
38
38
  const marker = getDependFilePath(resource.request, buildTargetRelease);
39
39
  if (marker) resource.request = marker;
40
40
  }).apply(compiler);
41
+ // A dependency's header (`@crossbind/port-zlib/zlib.h`) names the package, not a file: it lives in the
42
+ // package's prebuilt include directory for the target, as the Vite and Metro plugins resolve it.
43
+ new compiler.webpack.NormalModuleReplacementPlugin(new RegExp(`\\.(${state.config.ext.header.join('|')})$`), (resource) => {
44
+ const header = getDependFilePath(resource.request, buildTargetRelease);
45
+ if (header) resource.request = header;
46
+ }).apply(compiler);
41
47
  // Rust packages ship no JS entry at all (their package.json is just a name), so node
42
48
  // resolution can never find them. Each known cargo-type dependency gets an exact-match
43
49
  // alias onto its crate root; the loader's .rs branch turns that into the proxy module.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crossbind/plugin-webpack",
3
- "version": "2.0.0-beta.60",
3
+ "version": "2.0.0-beta.62",
4
4
  "description": "crossbind Webpack plugin: A tool for seamless C++ integration with the Webpack bundler.",
5
5
  "homepage": "https://github.com/crossbind/crossbind/tree/main/plugins/webpack#readme",
6
6
  "repository": {
@@ -11,8 +11,8 @@
11
11
  "type": "module",
12
12
  "main": "index.js",
13
13
  "dependencies": {
14
- "crossbind": "^2.0.0-beta.60",
15
- "@crossbind/core-embind-rust": "^2.0.0-beta.60"
14
+ "crossbind": "^2.0.0-beta.62",
15
+ "@crossbind/core-embind-rust": "^2.0.0-beta.62"
16
16
  },
17
17
  "peerDependencies": {
18
18
  "webpack": ">=5.0.0"