@cpp.js/plugin-webpack 2.0.0-beta.4 → 2.0.0-beta.5

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 +7 -6
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -37,15 +37,16 @@ export default class CppjsWebpackPlugin {
37
37
 
38
38
  async onDone({ compilation }) {
39
39
  const isDev = compilation.options.mode === 'development';
40
- createLib(buildTargetRelease, 'Source', { buildSource: true });
41
- createLib(buildTargetRelease, 'Bridge', { buildSource: false, nativeGlob: [`${state.config.paths.cli}/assets/commonBridges.cpp`, ...this.bridges] });
42
- await buildWasm(buildTargetRelease);
40
+ const buildTarget = isDev ? buildTargetDebug : buildTargetRelease;
41
+ createLib(buildTarget, 'Source', { buildSource: true });
42
+ createLib(buildTarget, 'Bridge', { buildSource: false, nativeGlob: [`${state.config.paths.cli}/assets/commonBridges.cpp`, ...this.bridges] });
43
+ await buildWasm(buildTarget);
43
44
  if (!isDev) {
44
45
  const output = state.config.paths.output === state.config.paths.build ? compilation.options.output.path : state.config.paths.output;
45
- fs.copyFileSync(`${state.config.paths.build}/${buildTargetRelease.jsName}`, `${output}/cpp.js`);
46
- fs.copyFileSync(`${state.config.paths.build}/${buildTargetRelease.wasmName}`, `${output}/cpp.wasm`);
46
+ fs.copyFileSync(`${state.config.paths.build}/${buildTarget.jsName}`, `${output}/cpp.js`);
47
+ fs.copyFileSync(`${state.config.paths.build}/${buildTarget.wasmName}`, `${output}/cpp.wasm`);
47
48
 
48
- const dataFilePath = `${state.config.paths.build}/${buildTargetRelease.dataTxtName}`;
49
+ const dataFilePath = `${state.config.paths.build}/${buildTarget.dataTxtName}`;
49
50
  if (fs.existsSync(dataFilePath)) {
50
51
  fs.copyFileSync(dataFilePath, `${output}/cpp.data.txt`);
51
52
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cpp.js/plugin-webpack",
3
- "version": "2.0.0-beta.4",
3
+ "version": "2.0.0-beta.5",
4
4
  "description": "Cpp.js Webpack plugin: A tool for seamless C++ integration with the Webpack bundler.",
5
5
  "homepage": "https://github.com/bugra9/cpp.js/tree/main/packages/cppjs-plugin-rollup#readme",
6
6
  "repository": "https://github.com/bugra9/cpp.js.git",
@@ -8,7 +8,7 @@
8
8
  "type": "module",
9
9
  "main": "index.js",
10
10
  "dependencies": {
11
- "cpp.js": "^2.0.0-beta.4"
11
+ "cpp.js": "^2.0.0-beta.5"
12
12
  },
13
13
  "keywords": [
14
14
  "cpp.js-plugin",