pob-babel
TypeScript icon, indicating that this package has built-in type declarations

38.0.3 • Public • Published

pob-babel

Build and watch with babel and typescript

What it does

  • Transpiles js and jsx files for specific envs (node, webpack, modern browsers webpack 2)
  • Transform yml files to json (for faster load)
  • Allow you to register plugins to transform more files by extension

Install

npm install --save-dev pob-babel

Also install babel plugins and presets

In package.json

{
  "pob": {
    "babelEnvs": [
      {
        "target": "node",
        "version": "14",
        "formats": ["es"]
      },
      {
        "target": "browser",
        "version": "modern",
        "formats": ["es"]
      },
      {
        "target": "browser",
        "formats": ["es"]
      }
    ],
    "entries": ["index"]
  }
}

Create rollup.config.mjs

import createRollupConfig from 'pob-babel/createRollupConfig.js';

export default createRollupConfig({
  cwd: new URL('.', import.meta.url).pathname,
});

How to use

Direct use

rollup --config rollup.config.mjs

With npm scripts npm run build

Edit your package.json:

{
  "scripts": {
    "build": "rollup --config rollup.config.mjs",
    "watch": "yarn build --watch"
  }
}

Readme

Keywords

none

Package Sidebar

Install

npm i pob-babel

Weekly Downloads

299

Version

38.0.3

License

ISC

Unpacked Size

150 kB

Total Files

17

Last publish

Collaborators

  • churpeau