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.
1 Answer
Reset to default 0I 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
版权声明:本文标题:plugin development - Files in build directory no longer working as expected 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736281940a1926483.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论