rollup / rollup-plugin-babel

This package has moved and is now available at @rollup/plugin-babel / https://github.com/rollup/plugins/tree/master/packages/babel
MIT License
702 stars 87 forks source link

Rollup still outputting arrow functions, despite having babelrc arrow-functions transformer #43

Closed krainboltgreene closed 8 years ago

krainboltgreene commented 8 years ago

Can't really figure out why?

node_modules/.bin/rollup --sourcemap --config rollup.config.js --input ./client/index.js --output ./tmp/client/index.js
{
  "sourceMaps": "both",
  "plugins": [
    "external-helpers",
    "syntax-flow",
    "transform-async-to-generator",
    "transform-async-to-module-method",
    "transform-class-constructor-call",
    "transform-class-properties",
    "transform-decorators",
    "transform-do-expressions",
    "transform-es2015-arrow-functions",
    "transform-es2015-block-scoped-functions",
    "transform-es2015-block-scoping",
    "transform-es2015-classes",
    "transform-es2015-computed-properties",
    "transform-es2015-destructuring",
    "transform-es2015-for-of",
    "transform-es2015-function-name",
    "transform-es2015-literals",
    "transform-es2015-object-super",
    "transform-es2015-parameters",
    "transform-es2015-shorthand-properties",
    "transform-es2015-spread",
    "transform-es2015-sticky-regex",
    "transform-es2015-template-literals",
    "transform-es2015-typeof-symbol",
    "transform-es2015-unicode-regex",
    "transform-es3-member-expression-literals",
    "transform-es3-property-literals",
    "transform-es5-property-mutators",
    "transform-eval",
    "transform-exponentiation-operator",
    "transform-export-extensions",
    "transform-flow-strip-types",
    "transform-function-bind",
    "transform-member-expression-literals",
    "transform-merge-sibling-variables",
    "transform-minify-booleans",
    "transform-object-assign",
    "transform-object-rest-spread",
    "transform-object-set-prototype-of-to-assign",
    "transform-property-literals",
    "transform-proto-to-assign",
    "transform-regenerator",
    "transform-runtime",
    "transform-simplify-comparison-operators",
    "transform-undefined-to-void",
    "typecheck"
  ]
}
import {rollup} from "rollup"
import babel from "rollup-plugin-babel"

rollup({
  format: "iife",
  plugins: [
    babel({
      exclude: "node_modules/**"
    })
  ]
})
TrySound commented 8 years ago

@krainboltgreene Config should be an object. Your rollup call don't do nothing. btw it should throw as you did not add entry option.

Try this

import babel from "rollup-plugin-babel"

export default {
  format: "iife",
  plugins: [
    babel({
      exclude: "node_modules/**"
    })
  ]
};
TrySound commented 8 years ago

@Rich-Harris @Victorystick I think we should throw an error if no one prop in config found.

Rich-Harris commented 8 years ago

@TrySound agreed https://github.com/rollup/rollup/pull/515

krainboltgreene commented 8 years ago

Thanks! On Feb 14, 2016 6:54 AM, "Bogdan Chadkin" notifications@github.com wrote:

Closed #43 https://github.com/rollup/rollup-plugin-babel/issues/43.

— Reply to this email directly or view it on GitHub https://github.com/rollup/rollup-plugin-babel/issues/43#event-549900122.

krainboltgreene commented 8 years ago

Oh, FYI I copied this rollout file from documentation.

TrySound commented 8 years ago

@krainboltgreene Nobody said it's cli config. It's Rollup API usage.

krainboltgreene commented 8 years ago

Then the documentation might be a little confusing.

TrySound commented 8 years ago

It's documentation of usage plugin, not cli, api, etc. For more information you should look at rollup usage here: https://github.com/rollup/rollup/wiki/JavaScript-API here https://github.com/rollup/rollup/wiki/Command-Line-Interface or here https://github.com/rollup/rollup/wiki/Build-tools

And then you just associate information of this plugin with the information from rollup wiki.