When I try to import a text file with import text from './some-text.txt!text';
I see the loader tries to fetch a text.js file from the root of the server.
Can this location be different and can the plugin be installed with say jspm?
Asked
Active
Viewed 640 times
0

olanod
- 30,306
- 7
- 46
- 75
2 Answers
3
I faced the same issue -- because it never mentions anything to the contrary, the documentation for using jspm plugins makes it seem like at least the "Supported Plugins" should just work out of the box, but it turns out, even these need to be first installed using jspm.
So, in order to get your import statement to work, and not have jspm try to fetch a text.js file from the server root, you just have to run jspm install text
to get the plugin up and running, and then you're good to go.

toomanydaves
- 73
- 6
2
You can change you base path using basePath
property of System
:
System.basePath = '/path/to/jspm';
For any particular module you can use paths
properties:
System.paths['some-text'] = '/path/to/some/text';
Then you can import it doing:
import text from 'some-text';
Read here

alexpods
- 47,475
- 10
- 100
- 94
-
It's not about the base path. It's about the configuring plugin 'text' and its location – olanod Jan 30 '15 at 23:31