@crossbind/plugin-webpack-loader 2.0.0-beta.62 → 2.0.0-beta.63
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.
- package/README.md +4 -4
- package/index.js +5 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -3,20 +3,20 @@
|
|
|
3
3
|
A tool for seamless C++ integration with the Webpack bundler.
|
|
4
4
|
|
|
5
5
|
<a href="https://www.npmjs.com/package/@crossbind/plugin-webpack-loader">
|
|
6
|
-
<img alt="NPM version" src="https://img.shields.io/npm/v/@crossbind/plugin-webpack-loader?style=for-the-badge" />
|
|
6
|
+
<img alt="NPM version" src="https://img.shields.io/npm/v/@crossbind/plugin-webpack-loader/beta?style=for-the-badge" />
|
|
7
7
|
</a>
|
|
8
8
|
<a href="https://github.com/crossbind/crossbind/blob/main/LICENSE">
|
|
9
9
|
<img alt="License" src="https://img.shields.io/github/license/crossbind/crossbind?style=for-the-badge" />
|
|
10
10
|
</a>
|
|
11
|
-
<a href="https://crossbind.
|
|
12
|
-
<img alt="Docs -
|
|
11
|
+
<a href="https://crossbind.dev/docs/guide/integrate-into-existing-project/webpack">
|
|
12
|
+
<img alt="Docs - Webpack" src="https://img.shields.io/badge/Docs_-_Webpack-20B2AA?style=for-the-badge" />
|
|
13
13
|
</a>
|
|
14
14
|
|
|
15
15
|
## Integration
|
|
16
16
|
To integrate crossbind into your project using Webpack as a bundler, you can utilize the @crossbind/plugin-webpack-loader plugin. Start by installing these package with the following command:
|
|
17
17
|
|
|
18
18
|
```sh
|
|
19
|
-
npm install @crossbind/plugin-webpack @crossbind/plugin-webpack-loader --save-dev
|
|
19
|
+
npm install @crossbind/plugin-webpack@beta @crossbind/plugin-webpack-loader@beta --save-dev
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
**Webpack**
|
package/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
async function crossbindLoader() {
|
|
2
2
|
const {
|
|
3
|
-
bridges, createBridgeFile, getCrossbindScript, getRustJsScript, state,
|
|
3
|
+
bridges, appSourceFiles, createBridgeFile, getCrossbindScript, getRustJsScript, state,
|
|
4
4
|
} = this.getOptions();
|
|
5
5
|
const target = state.targets.find((t) => t.platform === 'wasm');
|
|
6
6
|
|
|
@@ -11,7 +11,10 @@ async function crossbindLoader() {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
const bridgeFile = createBridgeFile(this.resourcePath);
|
|
14
|
-
|
|
14
|
+
// A header loads again after each source edit; a repeated entry would change the bridge lib's fingerprint.
|
|
15
|
+
if (!bridges.includes(bridgeFile)) bridges.push(bridgeFile);
|
|
16
|
+
// The names the app imports decide what a header binds, so watch mode loads it again after any source edit.
|
|
17
|
+
appSourceFiles(state.config.paths.project).forEach((file) => this.addDependency(file));
|
|
15
18
|
|
|
16
19
|
return getCrossbindScript(target, bridgeFile);
|
|
17
20
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crossbind/plugin-webpack-loader",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.63",
|
|
4
4
|
"description": "crossbind Webpack loader: A tool for seamless C++ integration with the Webpack bundler.",
|
|
5
5
|
"homepage": "https://github.com/crossbind/crossbind/tree/main/plugins/webpack-loader#readme",
|
|
6
6
|
"repository": {
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"main": "index.js",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"crossbind": "^2.0.0-beta.
|
|
13
|
+
"crossbind": "^2.0.0-beta.63"
|
|
14
14
|
},
|
|
15
15
|
"peerDependencies": {
|
|
16
16
|
"webpack": ">=5.0.0"
|