Skip to content

Commit

Permalink
Remove bundlerOptions for now
Browse files Browse the repository at this point in the history
  • Loading branch information
devongovett committed Feb 4, 2018
1 parent 43ea619 commit 127d339
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 21 deletions.
13 changes: 0 additions & 13 deletions src/transforms/babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,22 +116,9 @@ async function getBabelConfig(asset) {
/**
* Finds a .babelrc for an asset. By default, .babelrc files inside node_modules are not used.
* However, there are some exceptions:
* - if `bundlerOptions.babel` is set in package.json
* - if `browserify.transforms` includes "babelify" in package.json (for legacy module compat)
*/
async function getBabelRc(asset) {
// Check for a bundlerOptions key in package.json
let bundlerOptions = asset.package && asset.package.bundlerOptions;
if (bundlerOptions && bundlerOptions.babel) {
// Override the config with a bundler specific one if specified as an object
if (typeof bundlerOptions.babel === 'object') {
return bundlerOptions.babel;
}

// Otherwise, return the .babelrc
return await findBabelRc(asset);
}

// Support legacy browserify packages
let browserify = asset.package && asset.package.browserify;
if (browserify && Array.isArray(browserify.transform)) {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

4 changes: 2 additions & 2 deletions test/javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -534,9 +534,9 @@ describe('javascript', function() {
assert(!file.includes('class Bar {}'));
});

it('should compile node_modules if bundlerOptions is set', async function() {
it('should compile node_modules if legacy browserify options are found', async function() {
await bundle(
__dirname + '/integration/babel-node-modules-bundleroptions/index.js'
__dirname + '/integration/babel-node-modules-browserify/index.js'
);

let file = fs.readFileSync(__dirname + '/dist/index.js', 'utf8');
Expand Down

0 comments on commit 127d339

Please sign in to comment.