kickstart-mantrajs-webpack icon indicating copy to clipboard operation
kickstart-mantrajs-webpack copied to clipboard

public folder location

Open sandervanhooft opened this issue 8 years ago • 6 comments

Hi,

I've just tried hosting the public/ folder. By default, it should be in the root folder, so next to /src/.

Perhaps it would be better to host this from /src/public (and include it in the kickstarter)?

Related question: is there a ("best Mantra practice") way for including public resources in a Mantra module? It's a bit odd to be restricted to a public folder if a module depends on specific resources (i.e. template images).

Cheers,

Sander

sandervanhooft avatar Mar 09 '16 10:03 sandervanhooft

I am hosting public in my root folder as it is a resource folder. I am not sure how it would behave in the "src/public" folder. I guess this is on everyone's own preference.

tomitrescak avatar Mar 09 '16 22:03 tomitrescak

That's no problem. By default, it doesn't work from the src/public folder. I am hoping there will be a way to include public resources in Mantra modules, but it seems this is not going to happen anytime soon.

sandervanhooft avatar Mar 09 '16 22:03 sandervanhooft

In this webpack solution you can dynamically require resources and assets if I am not mistaken. You can even dynamically load CSS, please check out the documentation at the meteor-webpack website and check out their kickstart-flowrouter example.

tomitrescak avatar Mar 09 '16 22:03 tomitrescak

That would be really great, thank you! Still, I hope I can include this via Webpack inside a Mantra module :). Again, thanks!

sandervanhooft avatar Mar 09 '16 22:03 sandervanhooft

Just to be sure: you mean the npm meteor-webpack package, right?

sandervanhooft avatar Mar 09 '16 22:03 sandervanhooft

https://github.com/thereactivestack/kickstart-meteor-react-flowrouter

tomitrescak avatar Mar 09 '16 22:03 tomitrescak