@modern-js/libuild-plugin-babel-preset
TypeScript icon, indicating that this package has built-in type declarations

0.14.3 • Public • Published

@modern-js/libuild-plugin-babel-preset

npm version

A plugin for libuild to transform your code with @babel/preset-react, @babel/preset-typescript and babel-plugin-import

Tips

For compatibility with older applications, Libuild also supports user-defined Babel configurations, such as specifying additional babel plugins and babel presets, but please note: Using Babel will result in slower builds, so do not use Babel unless necessary.

Neither .babelrc nor babel.config.js in the project root will take effect. If you need to use Babel, you need to configure it in the libuild.config.ts file.

Usage

// libuild.config.ts
import { defineConfig } from '@modern-js/libuild';
import { babelPresetPlugin } from '@modern-js/libuild-plugin-babel-preset';

export = defineConfig({
  plugins: [
    babelPresetPlugin({
      import: [
        {
          libraryName: 'antd',
          style: false,
        }
        // babel-plugin-import options
      ], 
      react: {} // @babel/preset-react options
    }, {
      // babel-core transform options
    })
  ]
})

Options

preset options

react: babel-preset-react

import: babel-plugin-import

transform options

See here for babel transform options

Package Sidebar

Install

npm i @modern-js/libuild-plugin-babel-preset

Weekly Downloads

6

Version

0.14.3

License

ISC

Unpacked Size

44.9 kB

Total Files

7

Last publish

Collaborators

  • jserfeng
  • jingkai.zhao
  • sanyuan0704
  • derozan
  • xieqixuan.xx
  • shawzhou
  • chenjiahan
  • xuchaobei
  • webinfrabot
  • targeral
  • yimingjfe
  • caohuilin
  • kky_kongjiacong
  • bytednpm