0

Im trying to adopt JSPM as my package manager for Wordpress development but im failing at loading the main app file.

This is usually done with

  <script>
        System.import('./app');
  </script>

The problem im running into is that jspm fails to load this file, trying to load in context of the current browser path http://localhost:3000/shop/app.js instead of the file system context.

I've tried to adjust some of the jspm's configuration options but couldn't get it to work.

Can you point in the right direction here?

Luis Martins
  • 1,421
  • 2
  • 18
  • 32

1 Answers1

2

When running on file:/// URLs, you need to set your baseURL to the current path. This can be done with:

System.config({ baseURL: '.' });

Either in your configuration file or in the page itself. Note that when you load pages on different path levels, this baseURL path needs to be adjusted so it may be advisable to specify it in the page itself.

guybedford
  • 1,362
  • 11
  • 8