Skip to content
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

consuming with webpack for node.js and isomorphic #98

Open
joshunger opened this issue Aug 1, 2016 · 1 comment
Open

consuming with webpack for node.js and isomorphic #98

joshunger opened this issue Aug 1, 2016 · 1 comment

Comments

@joshunger
Copy link

Q. We're using script.js and webpack to bundle for both the browser and node.js. What is the best approach here to provide a fallback?

Current, as expected, I get this error (as expected) -

  var doc = document
            ^

ReferenceError: document is not defined

Which is from this code -

})('$script', function () {
  var doc = document
@Kronuz
Copy link

Kronuz commented Sep 6, 2017

document and head variables declaration only need to be moved to the create() function (so improt/require works in server side)

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

No branches or pull requests

2 participants