hanami / assets-js

esbuild plugin for Hanami Assets
3 stars 5 forks source link

Doesn't work with images under subdirectories #15

Closed parndt closed 8 months ago

parndt commented 11 months ago

I encountered this in a project and confirmed it with the decafsucks test project:

All that is needed to reproduce the error is:

mkdir -p slices/main/assets/images/test/
touch slices/main/assets/images/test/foo.png

Then running the asset compilation will fail as it's trying to treat the test directory as if it's a file:

npm run assets

> assets
> node config/assets.js

Error: Build failed with 1 error:
/Users/parndt/sandbox/decafsucks/node_modules/esbuild/lib/main.js:1495:32: ERROR: [plugin: hanami-esbuild] EISDIR: illegal operation on a directory, read
    at failureErrorWithLog (/Users/parndt/sandbox/decafsucks/node_modules/esbuild/lib/main.js:1650:15)
    at /Users/parndt/sandbox/decafsucks/node_modules/esbuild/lib/main.js:1059:25
    at /Users/parndt/sandbox/decafsucks/node_modules/esbuild/lib/main.js:1526:9
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  errors: [Getter/Setter],
  warnings: [Getter/Setter]
timriley commented 8 months ago

Fixed by #19.