Skip to content
This repository has been archived by the owner on Dec 26, 2018. It is now read-only.

Add support for babel options via browserify cli #235

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions lib/compilers/babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,18 @@ module.exports = function (raw, cb, compiler, filePath) {

try {
var babel = require('babel-core')

// browserify cli options
var opts = compiler.options.babel
if (opts) {
delete opts._
// "--opt [ a b ]" and "--opt a --opt b" are allowed:
if (opts.ignore && opts.ignore._) opts.ignore = opts.ignore._
if (opts.only && opts.only._) opts.only = opts.only._
if (opts.plugins && opts.plugins._) opts.plugins = opts.plugins._
if (opts.presets && opts.presets._) opts.presets = opts.presets._
}

var options = assign({
comments: false,
filename: filePath,
Expand Down