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

Support extensions: .mjs and .ts #76

Merged
merged 1 commit into from
Nov 12, 2018
Merged

Conversation

mottox2
Copy link
Contributor

@mottox2 mottox2 commented Nov 12, 2018

Fix #39. I would like to use TypeScript in netlify-lambda!

This PR added for .ts and .mjs extensions. I changed webpack config.

TypeScript sample

In order to use TypeScript, you need to install @babel/preset-typescript and define .babelrc as follows.

{
  "presets": [
+   "@babel/preset-typescript",
    [
      "@babel/preset-env",
      {
        "targets": {
          "node": "6.10.3"
        }
      }
    ]
  ],
  "plugins": [
    "@babel/plugin-proposal-class-properties",
    "@babel/plugin-transform-object-assign",
    "@babel/plugin-proposal-object-rest-spread"
  ]
}

@mottox2 mottox2 changed the title Support extensions: mjs and ts Support extensions: .mjs and .ts Nov 12, 2018
@swyxio
Copy link
Contributor

swyxio commented Nov 12, 2018

thanks! would welcome a PR on usage documentation as well

@swyxio swyxio merged commit 3ae931b into netlify:master Nov 12, 2018
mottox2 added a commit to mottox2/netlify-lambda that referenced this pull request Nov 15, 2018
stefan-- pushed a commit to stefan--/netlify-lambda that referenced this pull request Dec 2, 2018
@swyxio
Copy link
Contributor

swyxio commented Dec 3, 2018

needed this as well #80

@BaronBeans
Copy link

Do you need to do anything to get this working in production? I can use typescript locally to create and serve functions, but when I deploy to netlify the build fails.

@swyxio
Copy link
Contributor

swyxio commented Jul 2, 2019

make a new issue and show the build failure logs

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

Successfully merging this pull request may close these issues.

3 participants