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
Import conflict when using in a project along-side ember-auto-import #164
Comments
@urbany what version of the addon are you using? Using The only answer I have is that you stop using the shim yourself and use auto import + moment too. I believe that in that case it won't be duplicated. Keep me posted of what you find, I want to know for sure that it works. |
Thanks for the quick reply! I'm using 0.8.0. The only idea I have would be to have a way to control the excludes from the addons, since the excludes I add to my ember-cli-build don't take the addon imports into account. I would stop using the shim but I need to know how to prevent e-i-a from importing all the locales first I created an issue in e-i-a embroider-build/ember-auto-import#114 You might want to add something to the readme saying it is not compatible with the shim. |
So |
Yes it does, and I think that's the normal way because I see many posts about that in other platforms that use webpack, this seems to be a way of getting around that but not sure how to implement it with e-a-i: moment/moment#1435 (comment) |
FWIW, I'm working on finalizing
https://github.com/cibernox/ember-power-calendar-luxon
If you are not familiar with luxon, is also a project from the same people
as moment.js but with a modern API and that doesn't needs any locales as it
uses the Intl API in modern browsers. Depending on how much you use moment
the migration might take some time, but I switched and it's very good.
El jue., 23 ago. 2018 a las 18:51, João Teixeira (<notifications@github.com>)
escribió:
… Yes it does, and I think that's the normal way because I see many posts
about that in other platforms that use webpack, this seems to be a way of
getting around that but not sure how to implement it with e-a-i: moment/moment#1435
(comment)
<moment/moment#1435 (comment)>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#164 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAQMe0jZn39fNvskomTzQ7DFgAgofI_Tks5uTt11gaJpZM4WJ19Z>
.
|
@urbany I've released 0.8.1 in which I rollback to using the shim. Can you verify that the bundle size stays low and moment is not duplicated? I also believe now only the desired locales will be loaded. |
@cibernox we found a solution with e-a-i, check my comment there embroider-build/ember-auto-import#114 (comment) I'm testing it now to see if everything is ok, might be a good idea to stay with e-a-i here, or update the shim to use e-a-i internally. |
It would be great if ember-cli-moment-shim starts using e-a-i internally. Another bug about timezones was reported in #162 , which I believe it's because of the duplicated moment. Wether it's the best approach or not, ember-cli-moment-shim is by far more used today than e-a-i+moment, so I think that keep using it, even if it just for some transition period or weeks or months will ease the upgrade. |
After the comments here jasonmit/ember-cli-moment-shim#168 not sure what the solution will be so might be a good idea to warn people that if they use // in ember-cli-build.js
const IgnorePlugin = require('webpack').IgnorePlugin;
let app = new EmberApp(defaults, {
autoImport: {
exclude: ['moment'],
},
}); You might close this if you want. |
I want to highlight that since 0.8.1, this is not a problem anymore, as |
@cibernox I think the problem still exists if someone is already using e-a-i in their app to import moment, and then they install e-p-c-m which brings the shim into play. |
That is true, but since e-a-i is fairly new, most people will be using the shim. And for what I see on that thread, there are caveats with including the locales using e-a-i so the shims seems a better option right now. |
Hi, when using this addon in a project which also uses "ember-auto-import" the moment import in the addon seems to trigger ember-auto-import instead of
ember-cli-moment-shim
this way I end up with moment imported twice into my vendor.js
I tried using the
excluse
from ember-auto-import without success. Not sure if the problem is ehre or with https://github.com/ef4/ember-auto-importThe text was updated successfully, but these errors were encountered: