Skip to content
This repository has been archived by the owner on Sep 7, 2022. It is now read-only.

Inline scripts in <head> are run at incorrect time #42

Open
ryanwhite04 opened this issue Apr 8, 2016 · 0 comments
Open

Inline scripts in <head> are run at incorrect time #42

ryanwhite04 opened this issue Apr 8, 2016 · 0 comments

Comments

@ryanwhite04
Copy link

If you include an inline script in the head of the document, like here
which is shown on the polymer tutorial
the crisper causes the script to be run after polymer.html has loaded, which causes an error discussed here

There should be an option to ignore script tags in the head of a html document, since they occasionally need to be run synchronously in a specific order.

Perhaps
--ignore-head=true
and
ignoreHead: true

Until then, you can include such scripts
window.Polymer = window.Polymer || {}; Polymer.dom = 'shadow';

in an external file, "dom.js",
and I just reference is like so
<script src="components/webcomponentsjs/webcomponents-lite.js"></script>
<script src="scripts/dom.js"></script>
<!-- import a component that relies on Polymer -->
<link rel="import" href="elements/my-app.html">

Crisper will just leave them as they were, obviously make sure not to name it the same name as the html file with a js extension though, as by default crisper will overwrite such a file.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant