esbuild-typescript-loader
    TypeScript icon, indicating that this package has built-in type declarations

    0.2.2 • Public • Published

    esbuild-typescript-loader

    A simple webpack loader to transform TypeScript with esbuild, and only transform TypeScript.

    Options

    • loader

      Change how a given input file is interpreted.

      • Type: 'ts'|'tsx'
    • sourcemap

      Generate source map.

      • Type: boolean
    • target

      Target environment for the generated JavaScript code.

    Example

    webpack.config.js:

    module.exports = {
      module: {
        rules: [
          {
            test: /\.ts$/i,
            exclude: [/node_modules/],
            use: [
              'babel-loader',
              {
                loader: 'esbuild-typescript-loader',
                options: {
                  loader: 'ts',
                  sourcemap: true,
                },
              },
            ],
          },
          {
            test: /\.tsx$/i,
            exclude: [/node_modules/],
            use: [
              'babel-loader',
              {
                loader: 'esbuild-typescript-loader',
                options: {
                  loader: 'tsx',
                  sourcemap: false,
                },
              },
            ],
          },
        ],
      },
    }

    Install

    npm i esbuild-typescript-loader

    DownloadsWeekly Downloads

    12

    Version

    0.2.2

    License

    MIT

    Unpacked Size

    6.42 kB

    Total Files

    9

    Last publish

    Collaborators

    • chenxsan