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

42.2.0 • 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

909

Version

42.2.0

License

ISC

Unpacked Size

161 kB

Total Files

16

Last publish

Collaborators

  • churpeau