mizziness / craft3-webpack5-tailwind2-boilerplate

A real-world boilerplate for Craft CMS 3 projects that leverages Wepback 5, Tailwind 2, PostCSS 8, and has a hot-reload dev environment. Now with dynamic imports, asynchronous chunk loading, and legacy vs modern browser support!
MIT License
45 stars 11 forks source link

Hmm.. Im also experiencing the same, only when running yarn build the js/css is created. I assume a configuration issue? #9

Closed funkysoul closed 2 years ago

funkysoul commented 2 years ago

Hmm.. Im also experiencing the same, only when running yarn build the js/css is created. I assume a configuration issue?

Originally posted by @funkysoul in https://github.com/mizziness/craft3-webpack5-tailwind2-boilerplate/issues/8#issuecomment-940190355

storybynumbers commented 2 years ago

How did you get HMR working?

funkysoul commented 2 years ago

Like mentioned here:

Then install our other packages and run the HMR development server:

$ yarn install $ yarn dev (I use yarn for my project, but you don't need to - use the tool of your choice.)

Webpack assets are set up to serve from https://localhost:8080 by default.

Note: The URL "https://localhost:8080" won't show anything by default, but if you prefer to have a page load, you can edit wpconfig/webpack.dev.js and uncomment the new HtmlWebpackPlugin code block. This will generate an index.html file along with your assets.

storybynumbers commented 2 years ago

I followed those instructions, but all paths return the same "cannot load" error. Which makes sense to me, because the only files generated in the dist are manifest.json and stats.json. That commented out block generates an html file, but it's not a proper rendering of my homepage. The twig isn't processed. Am I missing something obvious here? (Thanks for the reply Tiago!)

funkysoul commented 2 years ago

Hmm.. when starting yarn dev do you see any errors? Is the hmr url still localhost:8080? Is any other service running on that port? Did you check twigpack config? Is local SSL setup and active? Just a couple of things that cause an issue ;) (You welcome) ;)

storybynumbers commented 2 years ago

It seems the issues arise from using Docker/Nitro. Many other people are struggling with it as well.

funkysoul commented 2 years ago

ah, sorry I don't use any of that...