loadable-transformer-ts5

1.0.1 • Public • Published

loadable-transformer-ts5

Compatible with Typescript V5

Changes added over loadable-ts-transformer

A TypeScript custom transformer for server side rendering with loadable-components.

Usage

This transformer is an alternative option for ts-loader user. It works as well as @loadable/babel-plugin does.

Install

$ npm install loadable-transformer-ts5 ts-loader webpack typescript -D

Configure webpack

/* webpack.config.js */
const { loadableTransformer } = require('loadable-transformer-ts5');

module.exports = {
    ...
    module: {
      rules: [
        {
          test: /\.tsx?$/,
          exclude: /node_modules/,
          loader: 'ts-loader',
          options: {
            getCustomTransformers: () => ({ before: [loadableTransformer] }),
          },
        },
      ],
    },
    ...
};

Remarks This transformer compiles import(...) expression. So you should set tsconfig --module option to "ES2015" or "ESNext".

License

MIT

Package Sidebar

Install

npm i loadable-transformer-ts5

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

34.1 kB

Total Files

17

Last publish

Collaborators

  • rage73