@csobj/heft-babel-plugin
TypeScript icon, indicating that this package has built-in type declarations

0.1.1-beta.0 • Public • Published

@csobj/heft-babel-plugin

This plugin will transpile source files only project owned, Files in node_modules not supported.

Quick Setup

/**
 * [config/babel.json]
 * Following json object describe configuration schema for this plugin and default value.
 */
{
    "$schema": "../node_modules/@csobj/heft-babel-plugin/lib/schemas/heft-babel-plugin.schema.json",
    "srcFolder": "src/",
    "outFolder": "lib/",
    // Files with those extensions are treat as source file.
    "fileExtensions": [
        ".js",
        ".ts"
    ],
    // File extension of generated code.
    "outputFileExtension": ".js",
    // The plugin will transform source codes as commonjs for tests.
    // It use @babel/plugin-transform-modules-commonjs internally.
    "emitFolderNameForTests": "lib-commonjs"
}
/* babel.config.cjs */
module.exports = (api) => {
    // This will block configuration file cached on @babel/core during watch mode
    api.cache(false);
  
    // It is sample configuration. You can use your own babel configuration also.
    // Just don't forget to setup dependencies on package.json of your project.
    return {
      presets: ['@babel/preset-typescript'],
      sourceMaps: 'both'
    };
};

Readme

Keywords

none

Package Sidebar

Install

npm i @csobj/heft-babel-plugin

Weekly Downloads

3

Version

0.1.1-beta.0

License

MIT

Unpacked Size

64.7 kB

Total Files

15

Last publish

Collaborators

  • csobj