0.2.0 • Published 9 months ago

ts-blank-loader v0.2.0

Weekly downloads
-
License
MIT
Repository
-
Last release
9 months ago

ts-blank-loader

npm version npm downloads

Typescript compilation using ts-blank-space with your favourite bundler.

Install

npm i ts-blank-loader

Usage in Rspack & Webpack

Typescript

// rspack.config.js or webpack.config.js

module.exports = {
  module: {
    rules: [
      {
        test: /\.ts$/,
        use: "ts-blank-loader",
      },
    ],
  },
}

TSX

// rspack.config.js

module.exports = {
  module: {
    rules: [
      {
        test: /\.tsx$/,
        use: [
          {
            loader: "builtin:swc-loader",
            options: {
              jsc: {
                parser: {
                  syntax: "ecmascript",
                  jsx: true,
                },
              },
            },
          },
          "ts-blank-loader",
        ],
        exclude: /node_modules/,
      },
    ],
  },
}
// webpack.config.js

module.exports = {
  module: {
    rules: [
      {
        test: /\.tsx$/,
        use: [
          {
            loader: "babel-loader", // Use Babel loader for transpiling JavaScript
            options: {
              presets: ["@babel/preset-env", "@babel/preset-react"], // Use presets for modern JavaScript and React
            },
          },
          "ts-blank-loader",
        ],
        exclude: /node_modules/,
      },
    ],
  },
}

License

MIT ©

0.2.0

9 months ago

0.1.0

9 months ago

1.0.0

9 months ago