Skip to content

The current .babelrc lookup logic does not work on Windows #189

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

Closed
ehmicky opened this issue Sep 5, 2019 · 2 comments
Closed

The current .babelrc lookup logic does not work on Windows #189

ehmicky opened this issue Sep 5, 2019 · 2 comments
Labels

Comments

@ehmicky
Copy link
Contributor

ehmicky commented Sep 5, 2019

When the current directory does not find any .babelrc, the directory passed as input is used searched instead. There might two issues with the current logic:

  1. the lookup starts with the ancestor, where it probably should start with the descendant
  2. the lookup relies on the path delimiter being /. This does not work on Windows.

#188 would solve both problems.

@aimee-gm
Copy link

aimee-gm commented Nov 2, 2019

A work-around here is to use a custom webpack configuration (works on windows).

For example:

webpack.functions.js

module.exports = {
  module: {
    rules: [
      {
        test: /\.ts?$/,
        exclude: /(node_modules|bower_components)/,
        use: {
          loader: "babel-loader",
          options: {
            presets: ["@babel/preset-typescript", "@babel/preset-env"],
          },
        },
      },
    ],
  },
};

and run netlify-lambda build <path_to_fn_folder> --config ./webpack.functions.js

@stale
Copy link

stale bot commented Jan 1, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jan 1, 2020
@stale stale bot closed this as completed Jan 8, 2020
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

2 participants