Nocturnal Pumpkin Maelstrom

    babel-preset-runtime

    1.0.3 • Public • Published

    babel-preset-runtime

    Extending @babel/preset-env

    Usage

    First, install Babel.

    Then install babel-preset-rutime.

        # npm
        npm install babel-preset-rutime
    
        # yarn
        yarn add babel-preset-rutime
    
    

    Then create a file named .babelrc or babel.config with following contents in the root folder of your project:

    {
    	"presets": ["babel-preset-rutime"]
    }

    Default configs of babel-preset-rutime

    //  @babel/preset-env
    {
    	"useBuiltIns": "entry",
    	"corejs": 3,
    	"exclude": ["transform-typeof-symbol"]
    }
    // @babel/plugin-transform-runtime
    {
        corejs: false,
        helpers: true,
        version: require("@babel/runtime/package.json").version,
        regenerator: true,
        absoluteRuntime: path.dirname(
    			require.resolve("@babel/runtime/package.json")
    		),
    }

    You can fully override default config

    {
    	"presets": [
    		[
    			"babel-preset-rutime",
    			{
    				//options of  @babel/preset-env
    				"env": {},
    				//options of @babel/plugin-transform-runtime
    				"runtime": {}
    			}
    		]
    	]
    }

    Add react support

    {
    	"presets": [
    		[
    			"babel-preset-rutime",
    			{
    				//options of @babel/preset-react
    				"react": {}
    			}
    		]
    	]
    }

    Keywords

    none

    Install

    npm i babel-preset-runtime

    DownloadsWeekly Downloads

    13

    Version

    1.0.3

    License

    MIT

    Unpacked Size

    3.82 kB

    Total Files

    4

    Last publish

    Collaborators

    • fizwen