Menu icon Foundation

My Posts

No Content

My Comments

Stefan Frank commented on Chad Nelson's post about 2 years

var $ = require('jquery');

window.$ = $
window.jQuery = $
window.$(document).foundation()

instead of the import did the trick for me: The reason here seems to be, that the require works synchronously and actually waits for the until jquery has been resolved, whereas the import works asynchronous and you hit upon the reference-error. Until there is a fix for jquery to behave properly with imports, this way to initialize foundation works good enough for me...
Until there is a fix for jquery to behave properly with imports, this way to initialize foundation is simple enough and I can live with the slight performance-hit for the synchronous resolve...

Posts Followed


Following

    No Content

Followers

My Posts

No Content

My Comments

You commented on Chad Nelson's post about 2 years

var $ = require('jquery');

window.$ = $
window.jQuery = $
window.$(document).foundation()

instead of the import did the trick for me: The reason here seems to be, that the require works synchronously and actually waits for the until jquery has been resolved, whereas the import works asynchronous and you hit upon the reference-error. Until there is a fix for jquery to behave properly with imports, this way to initialize foundation works good enough for me...
Until there is a fix for jquery to behave properly with imports, this way to initialize foundation is simple enough and I can live with the slight performance-hit for the synchronous resolve...

Posts Followed

Following

  • No Content

Followers

  • No Content