Skip to content
This repository was archived by the owner on Feb 18, 2024. It is now read-only.

adding bootstrap-datepicker#204

Open
Jarreddebeer wants to merge 2 commits into
jspm:masterfrom
Jarreddebeer:master
Open

adding bootstrap-datepicker#204
Jarreddebeer wants to merge 2 commits into
jspm:masterfrom
Jarreddebeer:master

Conversation

@Jarreddebeer

Copy link
Copy Markdown
Collaborator

No description provided.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line isn't necessary - rather add css as a dependency of the package to download - https://github.com/jspm/registry/blob/master/package-overrides/github/twbs/bootstrap%403.1.0.json#L5. Also is Bootstrap itself a dependency?

@guybedford

Copy link
Copy Markdown
Member

Thanks!

@cAhmad

cAhmad commented Jun 7, 2016

Copy link
Copy Markdown

Hi, they updated their project to match npm requierement.
The only override I needed to make the main lib works is:

"map": {
  "jquery": "@empty"
},

Because it brings jQuery from npm and I already had it from Github

But, importing a specific locale cause issue for me, I'm not able to make this works.

import 'bootstrap-datepicker';
import 'bootstrap-datepicker/dist/locales/bootstrap-datepicker.fr.min';

When I bundle (SFX) my app it seems that the locale is called before the dapicker pluging is added to jQuery since I got this error:

bootstrap-datepicker.fr.min.js:2 Uncaught TypeError: Cannot read property 'dates' of undefined

I tried to add in my config.js

"meta": {
  "bootstrap-datepicker/dist/locales/bootstrap-datepicker.fr.min": {
    "deps": [
      "bootstrap-datepicker"
    ]
  },
}

It does not fix the issue.
I have jspm@0.16.36, and it works almost (somtimes it's broken like 0.16.36) correctly with jspm@0.16.2

Any help or tips would be really appreciated.

May relates to uxsolutions/bootstrap-datepicker#1781 and jspm/jspm#1294

Edit: I finally manage to make it works!!

I had to add a shim, so the override looks like this:

"npm:bootstrap-datepicker@1.6.1": {
  "map": {
    "jquery": "jquery"
  },
  "shim": {
    "dist/locales/*": {
      "deps": [
        "bootstrap-datepicker"
      ]
    }
  }
}

@guybedford

Copy link
Copy Markdown
Member

@cAhmad if you're able to share the above override with a new PR that would be great. Also the map: { 'jquery': 'jquery' } part shouldn't be necessary I think.

@cAhmad

cAhmad commented Jul 11, 2016

Copy link
Copy Markdown

Just submitted the PR.
Yeah the map: { 'jquery': 'jquery' } is not necessary when using jquery from npm.

@guybedford

Copy link
Copy Markdown
Member

Great thanks for coming back to this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants