-
Notifications
You must be signed in to change notification settings - Fork 18
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
use ember-auto-import #250
Conversation
I'm not sure what's going on but locally i've got errors.
Investigating |
It's because of ember-cli-concat. ember-auto-import expects the DOM to include vendor+app scripts, which are currently commented out. Try putting them back in and remove {{concat-js}} https://github.com/internet4000/radio4000/blob/master/app/index.html#L28-L30 |
Ty! Will try this. |
Took some (much) time and trial and error…… If you expand the error when you start the server, it says
and that line is: if (typeof document !== 'undefined') {
__webpack_require__.p = Array.prototype.slice.apply(document.querySelectorAll('script'))
.filter(function(s){ return /\/vendor/.test(s.src); })[0]
.src.replace(/\/vendor.*/, '/'); and then I remembered that we don't have vendor.js in our index.html. Tried adding it back and then it worked! Opened an issue here embroider-build/ember-auto-import#87 In any case, I'd say we skip concat for our scripts. Since we have HTTP2 with Netlify it should be ok (better even?) with more files, smaller file sizes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool! @hugurp mind keeping the radio4000.js script async
? And remove ember-browserify.
app/index.html
Outdated
<!-- <script src="{{rootURL}}assets/radio4000.js"></script> --> | ||
{{content-for "concat-js"}} | ||
<script src="{{rootURL}}assets/vendor.js"></script> | ||
<script src="{{rootURL}}assets/radio4000.js"></script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mind keeping this one as async
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why keeping?
just the one on line 28?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, just the second. So we're sure it loads after the first.
It should be faster when async, so it doesn't block rendering.
Thank you for your service.
Start using https://github.com/ef4/ember-auto-import
instead of the traditional
import {someThing} from npm:some-thing