Skip to content
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

Webpack dev-server returns a directory listing. #28

Closed
PjGeeroms opened this issue Aug 17, 2020 · 3 comments
Closed

Webpack dev-server returns a directory listing. #28

PjGeeroms opened this issue Aug 17, 2020 · 3 comments
Labels
question Further information is requested

Comments

@PjGeeroms
Copy link

PjGeeroms commented Aug 17, 2020

Helloa,

First of all, a big thanks for all the work you put into your blogs and sharing this with us all.
Being pretty new to Craft I started reading your blogposts and started to introduce some of your methodologies here and there. Some were implemented easier than some others 😅.

I now started to merge your Annotated Webpack config in my project together with the whole templating structure you are using that i modified here and there but i ran in a little hickup. I know about the docker setup you have as well but somethings like the nginx setup and webperf is a bit much atm for the projects I'm running.

The issue
When i start the webpack config it doesn't seem to work like it's supposed to,
when going to localhost:8080 it's showing me a directory listing where I'm probably supposed to see the website through the webpack-dev-server. Also when changing things in the pcss files it doesn't seem to compile, I probably missed something silly...

For ease I pushed the setup I have now to: https://github.com/PjGeeroms/Projects2.0
I would appreciate it a TON if you could help me out, been stuck on this for a few days now 😭

Screenshots:
https://imgur.com/olJDa0m.jpg
https://imgur.com/N6B23Om.jpg
https://imgur.com/ZTXzOGE.jpg

@PjGeeroms PjGeeroms added the question Further information is requested label Aug 17, 2020
@PjGeeroms PjGeeroms changed the title Webpack config returns a directory listing. Webpack dev-server returns a directory listing. Aug 18, 2020
@mtwalsh
Copy link

mtwalsh commented Aug 21, 2020

That's expected behaviour. What you are aiming for is to run your Craft CMS site locally at domain.test for example where you have Homestead, Laragon, or whatever serving your site and that's the URL you access when developing and then you use a plugin such as Twigpack so that any assets in your site e.g. CSS, JS, etc. would be requested from the localhost:8080 URL where you have webpack-dev-server running. So essentially you shouldn't be requesting the webpack-dev-server URL (localhost:8080) directly, that's not how the setup is intended to work.

Hope that helps!

@PjGeeroms
Copy link
Author

@mtwalsh , That actually helped tons!
I started going through the whole config and noticed it was indeed loading everything so i knew twigpack was doing it's stuff.
What i didn't notice at first was that the POLL setting was set to 0, hence why it wasn't picking up the changes and only when i did a rebuild manually.

Anyway, I got it to work!
Changing pcss for more complex sections on a site takes some time to rebuild though,
I guess it's recompiling tailwind every time because js changes seem to work fine (11s vs 2), also working on a 13" Macbook Pro which doesn't exactly have the highest processing power. Anyway it's a minor thing in my eyes.

Happy it works, thanks for the help @mtwalsh !

@mtwalsh
Copy link

mtwalsh commented Aug 25, 2020

@PjGeeroms You're welcome! Glad it helped you sort the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants