Skip to content

sdu-react-scripts-babel-plugins 2.0.1-develop.1

Install from the command line:
Learn more about npm packages
$ npm install @elseu/sdu-react-scripts-babel-plugins@2.0.1-develop.1
Install via package.json:
"@elseu/sdu-react-scripts-babel-plugins": "2.0.1-develop.1"

About this version

Babel Plugins

install babel-plugins

npm install -D @elseu/sdu-react-scripts-babel-plugins

transform-titan-pure-annotations

With this babel plugin you can transform @elseu/sdu-titan to make it export only pure functions. Since sdu-titan exports a hoc names withTitan, many frameworks don't recognize this as a pure function. You can use this babel plugin with rollup like this:

// .babelrc
{
  "plugins": [
    "@elseu/sdu-react-scripts-babel-plugins/transform-titan-pure-annotations"
  ]
}
// rollup.config.mjs
import createDefaultRollupConfig from '@elseu/sdu-react-scripts-rollup';
import { babel } from '@rollup/plugin-babel';
import { readFile } from 'fs/promises';

const pkg = JSON.parse(await readFile(new URL('./package.json', import.meta.url)));

const defaultRollupConfig = createDefaultRollupConfig.default(pkg);

export default {
  ...defaultRollupConfig,

  plugins: [
    ...defaultRollupConfig.plugins,

    // Rollup babel plugin added below
    babel({
      babelHelpers: 'bundled',
      extensions: ['.ts', '.tsx'],
    }),
  ],
  // Your custom Rollup config here...
};

Details


Assets

  • sdu-react-scripts-babel-plugins-2.0.1-develop.1.tgz

Download activity

  • Total downloads 376
  • Last 30 days 0
  • Last week 0
  • Today 0