@companion-module/tools 2.0.1 → 2.0.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.0.2](https://github.com/bitfocus/companion-module-tools/compare/v2.0.1...v2.0.2) (2024-09-08)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * build script bad webpack path for some projects ([a35529b](https://github.com/bitfocus/companion-module-tools/commit/a35529b042ff0a93dc281da2a85ef77ff002b503))
9
+
3
10
  ## [2.0.1](https://github.com/bitfocus/companion-module-tools/compare/v2.0.0...v2.0.1) (2024-09-08)
4
11
 
5
12
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@companion-module/tools",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "license": "MIT",
package/scripts/build.js CHANGED
@@ -44,7 +44,9 @@ for (const [k, v] of Object.entries(webpackArgs)) {
44
44
  // build the code
45
45
  $.cwd = toolsDir
46
46
  const webpackConfig = path.join(toolsDir, 'webpack.config.cjs').replace(/\\/g, '/') // Fix slashes because windows is a pain
47
- const webpackPath = path.join(toolsDir, 'node_modules', '.bin', 'webpack').replace(/\\/g, '/') // Fix slashes because windows is a pain
47
+ let webpackPath = path.join(toolsDir, 'node_modules', '.bin', 'webpack').replace(/\\/g, '/') // Fix slashes because windows is a pain
48
+ // Try the level above too
49
+ if (!fs.existsSync(webpackPath)) webpackPath = path.join(toolsDir, '../../.bin/webpack').replace(/\\/g, '/') // Fix slashes because windows is a pain
48
50
  // Use a manual path to the webpack binary to avoid issues with yarn versions
49
51
  await $`${webpackPath} -c ${webpackConfig} ${webpackArgsArray}`
50
52
  $.cwd = undefined