-
Notifications
You must be signed in to change notification settings - Fork 0
replace AMD with Browserify (fixes #48) #50
Conversation
var runtime = {}; | ||
runtime.utils = new Utils(); | ||
window.addEventListener('DOMContentLoaded', function () { | ||
// Wait for the document to load so the constructors can |
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.
Can we just add a defer
to the <script>
tag instead, and leave out this change?
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.
I thought about moving to the foot, but yeah I'll defer.
@@ -3,7 +3,7 @@ | |||
<meta charset="UTF-8"> | |||
<title>Horizon</title> | |||
<link rel="stylesheet" href="css/navigation.css"> | |||
<script data-main="js/browser" src="js/ext/require.js"></script> | |||
<script defer src="js/main.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.
if you want me to rename this, let me know - I don't mind either way
@KevinGrandon good to merge? |
@cvan - I tried it out and I couldn't get sourcemaps working for me. Do they work for you? Seeing the following error: Error loading source: |
browserify/browserify#681 (comment) I didn't notice it because the mapping in the Console looked okay. but yeah the Sources are borked. in Chrome, the Sources are fine. |
I'm going to try to remove the relative references, though I really wish we could keep those. or I'll just ask @fitzgen. |
@KevinGrandon fixed by using https://github.com/thlorenz/mold-source-map to normalise the paths, but seems like a legit Firefox DevTools bug to me. |
0971b1a
to
9c9fa95
Compare
I'm gonna merge this now, since it seems to work beautifully 🌾 |
replace AMD with Browserify (fixes #48)
I ended up having to do Browserify modules because I couldn't load a browserify module or a script that exported to the global
window
, without doing gross file copying + Require.js shimming.anyway, it was simple enough to switch to Browserify. so now we can require external Node packages and Browserify modules like a boss 🍰.