-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
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
include jspm package configuration #11617
Conversation
What's the usage around jspm? Never heard of it. |
@mdo if you're worried about the "jspm" prefix, the same configuration also works at the base level of the package.json. As much as possible it extends existing properties like "directories". The only new properties are "shim" and "buildConfig" in this case. Let me know if you want to go this route. We're in early adoption - I completely understand if you only want to support something completely established, it just makes it much easier to maintain having this information in the package itself instead of needing the override service. |
The actual code isn't really of concern to me, only that we're not getting ahead of ourselves in supporting something new and not screwing up anything for the rest of the |
|
I suppose the question is more whether Bootstrap wants to be seen to be supporting a new technology. That's why I suggested the non-jspm prefixed base-level configuration of: package.json: {
"main": "js/bootstrap"
, "directories": { "lib": "dist" }
, "shim": {
"js/bootstrap": {
"imports": "jquery"
, "exports": "$"
}
}
, "buildConfig": { "uglify": true }
} in case this is the real issue here. In this case consider that jspm has specified the |
With the code you have above, it would make sense that any such technology that loads Bootstrap as a singular package could use the configuration--it wouldn't be specific to JSPM. |
include jspm package configuration
👍 |
Amazing, thanks! |
With this configuration in the package.json, Bootstrap can be included in a page through jspm with:
http://jsbin.com/osIYuDOJ/1/edit
This includes minification with source maps, shimming the jquery dependency, setting the main entry point and loading resources from the "dist" folder.
For example, this approach is used by http://getkickstrap.com/, a Bootstrap framework.
Bootstrap itself isn't downloaded as a clone of the Github repo, rather the Github release is detected and used instead.
Questions welcome, I know package.json littering can be a contentious issue. There are other options as well so happy to discuss this.