Skip to content

can .js file be loaded without using require() #64

Answered by chrisgordon
chrisgordon asked this question in Q&A
Discussion options

You must be logged in to vote

The js code is built with Haxe and by itself the code can be imported and executed from a require() call. I was able to get it working with some tweaks. The issue was with some third party js libraries that needed to run in a global context.

  • I removed one that really wasn't needed in a prod build
  • For another, instead of embedding it in my js code, I load it from a script tag. However I renamed the extension to .j so it wouldn't get encrypted

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by sleeyax
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant