JSPM

  • Created
  • Published
  • Downloads 482
  • Score
    100M100P100Q89458F
  • License MIT

Webpack loader powered by swc

Package Exports

  • @swc-node/loader
  • @swc-node/loader/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@swc-node/loader) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@swc-node/loader

🚀 Help me to become a full-time open-source developer by sponsoring me on Github

Downloads

Usage

{
  test: /\.tsx?$/,
  use: [
    {
      loader: '@swc-node/loader',
      // If options not passed
      // `@swc-node/loader` will read the project `tsconfig.json` as compile options
      // If the default `tsconfig.json` parse failed or not existed
      // The default options will be used
      // `compilerOptions` is the same with `compilerOptions in tsconfig`
      options: {
        // if `compilerOptions` provided, `configFile` will be ignored
        compilerOptions: {
          target: 'ES5',
          module: 'esnext',
          sourceMap: true,
          jsx: true,
        },
        // absolute path for tsconfig.json
        configFile: path.join(process.cwd(), 'tsconfig.build.json'),
        // enable react fast refresh
        fastRefresh: true
      }
    }
  ],
  exclude: /node_modules/,
}

Differences between swc-loader

This loader is compatible with tsconfig.json and compilerOptions in tsconfig.json.