Generate SystemJS config files from node_modules
Generate SystemJS config files from node_modules
The easiest way to include modules in SystemJS is currently through JSPM. This project aims to provide an alternative, by leveraging the deterministic installs of Yarn (also works with npm) and generating config files to explain to SystemJS how to resolve modules from node_modules
.
jspmPackage: true
Currently, given this package.json, SystemJS Config Builder generates this config.
You can test the generation via the cli in systemjs-tools.
yarn global add systemjs-tools
add SystemJS @node browser polyfills
yarn add systemjs-nodelibs
and generate the config
systemjs config
optionally you can also add a postinstall hook to do this automatically
package.json
{
"scripts": {
"postinstall": "systemjs config"
}
}
Thanks to Juha Järvi for helping me flesh out this idea and for the discussions regarding his awesome cbuild project.