Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't seem to work? #18

Open
unional opened this issue Feb 8, 2017 · 12 comments
Open

Doesn't seem to work? #18

unional opened this issue Feb 8, 2017 · 12 comments

Comments

@unional
Copy link

unional commented Feb 8, 2017

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.

@unional
Copy link
Author

unional commented Feb 8, 2017

I'm using yarn: 0.19.1, npm: 4.0.5, node: 7.5.0

@alexisvincent
Copy link
Owner

I think the command has changed to generate-config. Run systemjs --help to verify.

@unional
Copy link
Author

unional commented Feb 8, 2017

Thanks. It now complains:

:: exiting :: couldn't find a valid systemjs-tools config

@alexisvincent
Copy link
Owner

Damn. I recently changed how systemjs initializes itself. Just heading in to a meeting now. Can fix after that.

@unional
Copy link
Author

unional commented Feb 8, 2017

No problem. Take your time. 🌷
Thanks for the good work.

@alexisvincent
Copy link
Owner

@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"
    }
    ...
}

@alexisvincent
Copy link
Owner

@unional did this solve your issue?

@unional
Copy link
Author

unional commented Feb 10, 2017

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?

@alexisvincent
Copy link
Owner

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

@simondiep
Copy link

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.

@alexisvincent
Copy link
Owner

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.

@simondiep
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants