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

set module directory in babel #149

Open
mattkrick opened this issue Apr 23, 2016 · 1 comment
Open

set module directory in babel #149

mattkrick opened this issue Apr 23, 2016 · 1 comment

Comments

@mattkrick
Copy link
Owner

currently some files use relative directories because although webpack knows to look in src, the server doesn't use webpack & gets lost (see ducks, or any other SSR file). To solve this, i can add the module directory to babel on the server & then all paths can be written as absolutes but be relative to src.

untested code example:

resolveModuleSource: function (source, filename) {
    return resolve.sync(source, {
      basedir: path.resolve(filename, ‘..’),
      extensions: [‘.js’],
      moduleDirectory: [
        ‘src’,
        ‘node_modules’,
      ],
    });
  },
@jedwards1211
Copy link
Contributor

I'm looking into this. I had to make worker.babel.js to get resolution to work in the worker process as well as the server process.

Right now it's breaking AVA tests because I can't figure out how to get AVA to run the custom babel-register before each and every test in the glob pattern...

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

No branches or pull requests

2 participants