systemjs-config-builder
systemjs-config-builder copied to clipboard
Doesn't seem to work?
I follow the example to do:
// in an empty folder.
yarn global add systemjs-tools
yarn add systemjs systemjs-nodelibs systemjs-plugin-babel react react-dom
systemjs config
But the systemjs config
just exit and no generated.config.js
is created.
I'm using yarn
: 0.19.1, npm
: 4.0.5, node
: 7.5.0
I think the command has changed to generate-config. Run systemjs --help to verify.
Thanks. It now complains:
:: exiting :: couldn't find a valid systemjs-tools config
Damn. I recently changed how systemjs initializes itself. Just heading in to a meeting now. Can fix after that.
No problem. Take your time. 🌷 Thanks for the good work.
@unional Just had a look, I actually use the config for systemjs-tools
, so to fix this, in your package.json, add:
{
...
"systemjs-tools": {}
...
}
This will indicate to config builder where the root is. You can also customize the cache file location via
{
...
"systemjs-tools": {
"cache": ".myCustomeCacheFile.json"
}
...
}
@unional did this solve your issue?
I see. Have not try it yet.
Is it possible to make it not rely on this?
IMO it sounds like an optional configuration.
Are you doing a lookup in folder structure to find the root package.json
?
Yes, and then it uses the file it finds to act as a 'root'. But can probably offer a default. Although this isn't high priority for me right now
Could you add some documentation on how the cache works? Every time I run generate-config, it takes a long time to complete, and don't see any cache files created.
I don't have time to write docs right now, since I'm right in the middle of exams, but you can take a look here https://github.com/alexisvincent/systemjs-tools/blob/master/lib/cli.js#L21
It gets the cache out of the systemjs cache. You should see a .systemjs.cache.json
file, which you configure by the cache key in the config. Checkout https://github.com/alexisvincent/systemjs-tools/blob/master/docs/config.md.
There might be a bug with the cache generation, as I see a systemjs.cache file created but with contents of undefined
.
https://github.com/alexisvincent/systemjs-config-builder/blob/master/lib/index.js#L425