Comparing version 0.1.0-alpha.10 to 0.1.0-alpha.11
{ | ||
"name": "fbjs", | ||
"version": "0.1.0-alpha.10", | ||
"version": "0.1.0-alpha.11", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -12,4 +12,13 @@ /** | ||
var babelPluginModules = require('../babel/rewrite-modules'); | ||
var babelPluginModules = require('./rewrite-modules'); | ||
var inlineRequires = require('./inline-requires'); | ||
var plugins = [babelPluginModules]; | ||
if (process.env.NODE_ENV === 'test') { | ||
plugins.push({ | ||
position: 'after', | ||
transformer: inlineRequires, | ||
}); | ||
} | ||
module.exports = { | ||
@@ -24,3 +33,3 @@ nonStandard: true, | ||
stage: 1, | ||
plugins: [babelPluginModules], | ||
plugins: plugins, | ||
_moduleMap: { | ||
@@ -27,0 +36,0 @@ 'core-js/library/es6/map': 'core-js/library/es6/map', |
@@ -0,18 +1,29 @@ | ||
/** | ||
* Copyright 2013-2015, Facebook, Inc. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. An additional grant | ||
* of patent rights can be found in the PATENTS file in the same directory. | ||
*/ | ||
var assign = require('object-assign'); | ||
var babel = require('babel'); | ||
var babelDefaultOptions = require('../babel/default-options'); | ||
var createCacheKeyFunction = require('./createCacheKeyFunction'); | ||
var babelOpts = assign({}, babelDefaultOptions, { | ||
retainLines: true, | ||
}); | ||
module.exports = { | ||
process: function(src, filename) { | ||
return babel.transform(src, assign( | ||
{}, | ||
babelDefaultOptions, | ||
{ | ||
filename: filename, | ||
retainLines: true | ||
} | ||
)).code; | ||
}, | ||
module.exports = { | ||
process: function(src, path) { | ||
// TODO: Use preprocessorIgnorePatterns when it works. | ||
// See https://github.com/facebook/jest/issues/385. | ||
if (!path.match(/\/node_modules\//) && !path.match(/\/third_party\//)) { | ||
return babel.transform(src, assign({filename: path}, babelOpts)).code; | ||
} | ||
return src; | ||
} | ||
// Generate a cache key that is based on the module and transform data. | ||
getCacheKey: createCacheKeyFunction([__filename]) | ||
}; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
162378
122
4558
22