0

I'm developing a JS app http://myclibu.com which shares code between Node.js on the server and code in the Browser. And I'm migrating from using require.js to jspm.io for module loading in the Browser.

My ideal folder structure is

app -|- browser
     |- server
     |- shared

However so far I can't get config.paths in JSPM to work with files outside of the browser folder (outside of baseURL) which means I need to copy shared into browser to get files to load.

Is there any way I can use the folder structure as shown above? Note that I'm developing on Windows, in case that matters.

nevf
  • 4,596
  • 6
  • 31
  • 32
  • I belive the best way to go about it is to create three separate modules where browser and server depend on shared. If you do find another solution, I'd love to hear it. – Henrik Karlsson Jan 07 '16 at 22:18
  • I don't know enough about jspm to do that. ```require()``` in both Node and in require.js can access files outside of the project root so in browser I can ```require( "../shared/file" )``` and it works fine, but not in jspm which is an issue. – nevf Jan 08 '16 at 02:04

0 Answers0