webpack-config-typescript

5.0.1 • Public • Published

webpack-config-typescript

Write as little webpack configuration needed to bundle Lambda functions written in TypeScript.

Usage

  1. Install. This will add a barebones tsconfig and tslingt file into your root folder.
$ npm i webpack-config-typescript -D
$ nano webpack.config.js
  1. Wrap your webpack configuration using the exported function
const path = require('path')
const webpackTs = require('webpack-config-typescript')
 
let config = {
  entry: path.join(__dirname, 'src/handler.ts'), // <- your entry file
  target: 'node', // <- For Lambdas
  output: {
    filename: 'deploy/handler.js', // <- output file
    libraryTarget: 'commonjs2', // <- output library type
    path: path.join(__dirname)
  }
}
 
config = webpackTs.ts(config) // <- Here is where it gets configured
 
module.exports = config 
  1. webpack
  2. Your src should now be linted, transpiled, and bundled

License

MIT

Package Sidebar

Install

npm i webpack-config-typescript

Weekly Downloads

0

Version

5.0.1

License

MIT

Unpacked Size

16.8 kB

Total Files

14

Last publish

Collaborators

  • claudiordgz