-
Notifications
You must be signed in to change notification settings - Fork 66
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
Using Parcel creates the mess in client side code #211
Comments
I don't think you can mix the projects like this. the bootstrap-grayscale comes already with a bundler, gulp. so either use that, or refactor the code so that it works with parcel. IMO, the client source files should be outside of |
I rearranged some code to support both: kptdobe/helix-bootstrap-grayscale@master...tripodsan:parcel-support important is the you can now choose to use the absolute URLs in the html, and just use gulp to produce the files in |
Ah... I just realized I was testing on my 42-sectionizer branch. I had already realized the initial setup was wrong and I had already moved the Sorry for the confusion. |
In any case, I think we should really make it clear on what is supposed to be in webroot, webroot/dist, src, client... and when we need to edit the strain.yaml (which is still in the wrong place). |
Ok, I revisited the issue. I agree, my example was a mess.
-> this leads to a JS error: "Uncaught ReferenceError: $ is not defined" The code is working fine when ran on a standard http server:
-> this renders "Hello World"
I did not use any other bundler or extra magic. Finding the right way to make it work is almost impossible without knowing the internals. I need to adapt the code to something like:
Or did I miss something ? |
hmm... I don't think they transform the inline scripts... but I'll have a look. |
Check the console logs when page is rendered in a browser - multiple JS errors "jquery is not defined":
A quick first investigation leads to parcel-bundler/parcel#333
window.$
andwindow.jQuery
are not set because Parcel "protects" the window object. I tried the various workaround proposed (like setting something likewindow.$ = window.jQuery = parcelRequire('dist/vendor/jquery/jquery.min.js');
) and those leads to new dependency issues likerequire('jquery')
fires ajquery module does not exist
.Parcel clearly breaks some simple client side code while it should be completely invisible...
@tripodsan @trieloff
The text was updated successfully, but these errors were encountered: