Closed jaymcp closed 10 months ago
@jonmcp Which version of Build Tools are you running here?
I was actually running on #hotfix/handle-overwritten-externals
, but experience the same output on v1.2.2
@jonmcp I've done some testing and the problem isn't the missing asset-settings.php
, it's a missing inc/
directory. If that directory exists, then the asset-settings.php
file is created as expected.
I've found the following file and directory structures work as expected:
✅ Working:
inc/
src/
- entrypoints/
- frontend.js
✅ Working:
inc/
- asset_settings.php
src/
- entrypoints/
- frontend.js
❌ Failing:
src/
- entrypoints/
- frontend.js
Tested by using the example-site
and removing the inc
directories in test-client-plugin
and test-plugin
. The following command run:
cd example-site
node ../src/cli.js build --once test-client-plugin,test-plugin
Ah; thanks for that, and apologies for not attempting that during my testing prior to creating this issue.
I can confirm that adding an empty inc
directory resolves the error.
Would you like me to update the issue title and description for clarity?
@jonmcp Yeah that would be great thank you.
What happened?
When running a build, Build Tools assumes the existence of an
inc/
directory in the project root. If the directory doesn't exist, a raw error is thrown by Node.js as Build Tools attempts to write to the fileinc/asset-settings.php
.Ideally, Build Tools would attempt create the directory (if it doesn't exist); alternatively, a more user-friendly error message could be thrown.
The command I am running to reproduce this is
My directory structure looks like the following:
Which environments are you experiencing the issue on?
CLI (macOS, Windows, etc)
Relevant log output