admin管理员组

文章数量:1122846

I have a serious issue with the files in my build directory after running the wp-scripts build command. None of them work when I try to run my plugin. The build directory used to have files along the lines of index.js, index.js.map, index.css, and index.css.map. Now, I have files that are named 134.css, 134.js, and 855.js, just to name a few. I still have index.js and can find the other files being referenced in index.js.

The problem is, when I uploaded the new files to my live site, it completely broke my plugin. I've reset the permalinks from the dashboard without success (trying anything at this point). If you go to this page, try clicking either the "Customize and Buy" or the "Order Sample" buttons and you'll see that nothing happens. Also, they look like normal buttons without any of my css. /

This is a major issue for me and I really need this solved ASAP. I have updated all of my node modules, and this plugin does not rely on any other plugins to work. It has worked just fine with the current list of plugins. The site is using the most recent version of WordPress and should still work with the most recent modules that I updated today.

Please help!

Edited to add:

I have the following lines of code to load my build files on the site:

wp_enqueue_script('area-public-visualizer', plugin_dir_url(__FILE__) . 'build/index.js');
wp_enqueue_style('area-public-visualizer', plugin_dir_url(__FILE__) . 'build/index.css');

While I still have my index.js as mentioned earlier, I no longer have my index.css and no longer feel I can rely on the wp-scripts build command to not change the name of my css files in the future.

I have a serious issue with the files in my build directory after running the wp-scripts build command. None of them work when I try to run my plugin. The build directory used to have files along the lines of index.js, index.js.map, index.css, and index.css.map. Now, I have files that are named 134.css, 134.js, and 855.js, just to name a few. I still have index.js and can find the other files being referenced in index.js.

The problem is, when I uploaded the new files to my live site, it completely broke my plugin. I've reset the permalinks from the dashboard without success (trying anything at this point). If you go to this page, try clicking either the "Customize and Buy" or the "Order Sample" buttons and you'll see that nothing happens. Also, they look like normal buttons without any of my css. https://www.areapublic.com/product/willows/

This is a major issue for me and I really need this solved ASAP. I have updated all of my node modules, and this plugin does not rely on any other plugins to work. It has worked just fine with the current list of plugins. The site is using the most recent version of WordPress and should still work with the most recent modules that I updated today.

Please help!

Edited to add:

I have the following lines of code to load my build files on the site:

wp_enqueue_script('area-public-visualizer', plugin_dir_url(__FILE__) . 'build/index.js');
wp_enqueue_style('area-public-visualizer', plugin_dir_url(__FILE__) . 'build/index.css');

While I still have my index.js as mentioned earlier, I no longer have my index.css and no longer feel I can rely on the wp-scripts build command to not change the name of my css files in the future.

Share Improve this question edited Oct 13, 2024 at 21:59 fuxia 107k38 gold badges255 silver badges459 bronze badges asked Oct 13, 2024 at 17:53 jstrotherjstrother 1012 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

I actually just figured it out. I had my src/index.js waiting until the dom content loaded event fired. It had been working on previous versions, but for some reason the update that happened since I first built it no longer likes it. I had to remove the event listener on the window object. This got it to work as needed.

本文标签: plugin developmentFiles in build directory no longer working as expected