vite-for-wp icon indicating copy to clipboard operation
vite-for-wp copied to clipboard

[BUG] Manifest is created in wrong directory after build

Open j7-dev opened this issue 1 year ago • 1 comments

Hello,

I am grateful for your contributions. 🙏

I found a bug after I run `yarn build‵

Problem in "kucrut/vite-for-wp": "^0.8.0"

manifest.json will be created in dist/.vite directory which is WRONG

image

function get_manifest will try to find the manifest file in __DIR__ . '/js/dist', NOT in __DIR__ . '/js/dist/.vite'

That will cause an error, lead to empty assets, so the built js won't be enqueue.

No problem in "kucrut/vite-for-wp": "^0.5.2"

image


Update

It seems the manifest.json will be created in dist/.vite in vite 5

reference https://github.com/nystudio107/craft-vite/issues/77 https://www.drupal.org/project/vite/issues/3401054

j7-dev avatar Feb 18 '24 11:02 j7-dev

I resolve this with this commonJS temporary.

move dist/.vite/manifest.json to dist/manifest.json

https://github.com/j7-dev/wp-react-plugin/blob/master/release/mv-manifest.cjs

j7-dev avatar Apr 02 '24 06:04 j7-dev

This is fixed in #92.

kucrut avatar Jun 13 '24 15:06 kucrut