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

Bundler based compilers do not auto require #31

Open
wied03 opened this issue Apr 22, 2016 · 1 comment
Open

Bundler based compilers do not auto require #31

wied03 opened this issue Apr 22, 2016 · 1 comment
Labels

Comments

@wied03
Copy link
Collaborator

wied03 commented Apr 22, 2016

When using a Bundler based environment, load paths, etc. come in from Bundler auto requires.

When a compiler is built from the Bundler Opal version, Bundler.require is not issued in order to get any Opal compiler patches GEMs may apply.

Workaround is to use something like this:

const env = process.env
const path = require('path')

const requireDepLoadPath = path.join(require('child_process').execSync("ruby -e \"puts Gem::Specification.find_by_name('opal-require-dep').gem_dir\"").toString().trim(), 'lib')
env.OPAL_COMPILER_LOAD_PATH = requireDepLoadPath
env.OPAL_COMPILER_REQUIRES = path.join(requireDepLoadPath, 'opal-require-dep')
@wied03 wied03 added the bug label Apr 22, 2016
@wied03
Copy link
Collaborator Author

wied03 commented Apr 22, 2016

This might be challenging to fix, would need to determine what the bundler auto requires would be and then convert them to Opal requires since they need to be inside the compiled compiler file.

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

No branches or pull requests

1 participant