mantrajs / kickstart-mantrajs-webpack

Kickstart application with Mantrajs and meteor-webpack
45 stars 12 forks source link

public folder location #6

Open sandervanhooft opened 8 years ago

sandervanhooft commented 8 years ago

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

tomitrescak commented 8 years ago

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.

sandervanhooft commented 8 years ago

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.

tomitrescak commented 8 years ago

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.

sandervanhooft commented 8 years ago

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

sandervanhooft commented 8 years ago

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

tomitrescak commented 8 years ago

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