-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix hotloading #1209
Fix hotloading #1209
Conversation
Thanks, this looks great! Do we want to use the same port as CyPress though? I'd prefer another port for another env ( |
Ok, let's use |
webpack's (major) changelog: https://github.com/webpack/webpack/releases/tag/v4.0.0 laravel-mix's (major) changelog: https://github.com/JeffreyWay/laravel-mix/releases/tag/v5.0.0 How to test: - yarn run production should succeed and build the assets How to use hot reload: - $ php artisan serve --port 8081 - $ yarn run hot - Browse to http://localhost:8080 - Assets should be hot-reloaded. API calls should be proxied to your PHP server at http://localhost:8081
Hmm, now that I notice, why did Travis fail the build? |
Sorry, I was an idiot. |
I've pushed another commit to change the port to 8000. |
OK I finally have some time to dig a bit deeper into this. What do you think if we keep this change minimal? This should work: --- app/Application.php
+++ app/Application.php
@@ -45,7 +45,7 @@ class Application extends IlluminateApplication
if (isset($manifest[$file])) {
return file_exists(public_path('public/hot'))
- ? "http://localhost:8080{$manifest[$file]}"
+ ? "http://localhost:8080/public{$manifest[$file]}"
: $this->staticUrl("public{$manifest[$file]}");
}
index 7755125..dc44964 100644
--- webpack.mix.js
+++ webpack.mix.js
@@ -9,6 +9,12 @@ mix.webpackConfig({
output: {
chunkFilename: mix.config.inProduction ? 'js/[name].[chunkhash].js' : 'js/[name].js',
publicPath: '/public/'
+ },
+ devServer: {
+ port: 8080,
+ proxy: {
+ '/': 'http://127.0.0.1:8000/'
+ }
}
}) No other changes (webpack upgrade, submodule, tests…) have to be made, and we'll avoid CI breakages as well. |
This reverts commit 44729c4.
Can you allow project collaborators (me 😀) to push to your branches (both |
Hi, yes I'm fine with keeping it minimal. Upgrading webpack / laravel-mix should be done nonetheless but can be another PR. The "Allow edits from maintainers." checkbox is checked so you should be able to push to the branch. In case it's not enough I've invited you to the fork repo :) |
Thanks, I've pushed my changes. Let's see how it goes :) |
Thanks! |
webpack's (major) changelog: https://github.com/webpack/webpack/releases/tag/v4.0.0
laravel-mix's (major) changelog: https://github.com/JeffreyWay/laravel-mix/releases/tag/v5.0.0
How to test:
How to use hot reload:
server at http://localhost:8000
Note to reviewer:
EDIT: 8000 is now the port
- I chose 8088 as port number because that's what is expected by cypress tests. If another port is preferred, let me know.