wp-webpack-script
wp-webpack-script copied to clipboard
Dist folder is empty when running start script
Hi! First, thanks for the great framework. I would just like to ask you for a little help. I'm having trouble with configurations of the framework. I have defined the entry points in wpackio.project.js and use the wpackio/enqueue object to include all the assets in php file. When I run build script, the assets are bundle successfully inside dist folder and the wpackio/enqueue give me the right path to them. But when I run the start script the dist folder remains empty (only manifest.json file is inside), so the assets can not be included to wp. Thanks for the help!
Hi there. It looks like really cool workflow tool. Thank you! However I have the same problem, only manifest is created when I run start script.
Hi,
That's the intended behaviour. Files are served from memory when hit from right URL, that's why the PHP library is there. When you build though, files are written to disk.
Thanks for the help. When I run the build script I get the correct path from enqueue method of \WPackio\Enqueue: http://localhost:8888/[sub-filder]/wp-content/plugins/[plugin]/dist/assets/[file-name] and the file is there. But when I run the start script I get the path: //192.168.64.101:3000/[sub-filder]/wp-content/plugins/[plugin]/dist/assets/[file-name] and I get ERR_ABORTED 404 (Not Found) in browser. Do I need to add some additional settings or am I doing something wrong? Thanks, once again.
Hi, thanx for fast answer. I made a test to install wp directly to root of my local server (not use subfolder for wordpress installation), and then everything works great. So I guess problem is subfolder. (
even when I set proxy: http://localhost/{{sub-folder}} distPublicPath: {{sub-folder}}/wp-content/{{plugins|themes}}/{{slug}}/{{outputPath}}/
I see in doc ... Right now, we recommend having a Root WordPress installation (not sub-folder). If you have sub-folder installation, then put the whole URL as proxy like http://localhost/wp-plugin
So I guess it is in process.
Thanks for great tool and looking forward to sub-folder fix :)
Hi,
That is correct. If you have WordPress installed in sub-directory, then the proxy should also be the URL pointing to the WordPress instance.
distPublicPath is relative to the root (regardless of what you have in proxy, meaning if you have http://localhost/my-wp/ and distPublicPath set to hello-kitty/wp-content/plugin/my-plugin/dist/, the hot client will look at the path http://localhost/hello-kitty/.... I hope this explains.
Hi, Yes, but currently this approach:
proxy: http://localhost/{{sub-folder}} distPublicPath: {{sub-folder}}/wp-content/{{plugins|themes}}/{{slug}}/{{outputPath}}/
doesn't work for me. I get ERR_ABORTED 404 for processed assets.

So I just installed wordpress into root of my server temporarily as a workaround, but it would be great if subfolder installation works as well
I have the same issue, my Wordpress instance is also in a sub folder.
module.exports = {
proxy: 'http://localhost/<wp-folder>/',
distPublicPath: '<wp-folder>/wp-content/themes/<my-theme>/dist/',
};
Hello,
Please try this
module.exports = {
proxy: 'http://localhost/<wp-folder>/',
distPublicPath: '/wp-content/themes/<my-theme>/dist/',
};
Also kindly report back to me whether this works or not.
Hello,
Please try this
module.exports = { proxy: 'http://localhost/<wp-folder>/', distPublicPath: '/wp-content/themes/<my-theme>/dist/', };Also kindly report back to me whether this works or not.
Sorry I missed your answer, I will have a look
It doesn't work. I have the same issue. Please give me the correct answer for that
Then try this
module.exports = {
proxy: 'http://localhost/',
distPublicPath: '/<wp-folder>/wp-content/themes/<my-theme>/dist/',
};
Then try this
module.exports = { proxy: 'http://localhost/', distPublicPath: '/<wp-folder>/wp-content/themes/<my-theme>/dist/', };
Thanks this worked for me
Hello,
Thank you for the confirmation. Would you be kind to add this to our documentation?
so .. this does not seem to work for me. whatever i put in distPublicPath it does not change the path that gets loaded by wpack.io ...