systemjs / plugin-babel

SystemJS Babel Plugin
MIT License
83 stars 33 forks source link

babelOptions are ignored #33

Closed lookfirst closed 8 years ago

lookfirst commented 8 years ago

I'm getting this in the chrome console trying to load a large file...

VM101480:27 [BABEL] Note: The code generator has deoptimised the styling of "http://host.com:8080/js/util/redactor/redactor.js" as it exceeds the max of "100KB". window.console.error 
@ VM101480:27b.normalizeOptions 
@ systemjs-babel-browser.js:7b 
@ systemjs-babel-browser.js:7b.default 

I can't figure out where to add the 'compact: false' option. I have tried numerous places in SystemJS.config() in jspm.config.js to no avail...

SystemJS.config({
  transpiler: "plugin-babel",
  babelOptions: {
    "modularRuntime": false,
    "compact": false
  },
  meta: {
    "*.js": {
      "babelOptions": {
        "compact": false
      }
    }
  },
  packages: {
    "hub": {
      "format": "cjs",
      "main": "app.js",
      "meta": {
        "*.js": {
          "loader": "plugin-babel",
          "babelOptions": {
            "compact": false
          }
        }
      }
    }
  }
});
lookfirst commented 8 years ago

I can't set compact: false anywhere. I hand modified plugin-babel.js and that fixed things...

line: 154

    var output = babel.transform(load.source, {
      compact: false,
      babelrc: false,
guybedford commented 8 years ago

These formatting options aren't currently supported. I guess it would make sense to support passing these through, added in https://github.com/systemjs/plugin-babel/commit/1835b166639b5339066981593935aa924fbde716.