Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
module.exports = function(options, callback) {
var babel = require('babel-core');
var configDir = './.storybook';
var polyfillsPath = require.resolve('./default_config/polyfills.js');
var loadersPath = require.resolve('./default_config/loaders.js');
var configPath = path.resolve(configDir, 'config.js');
var babelConfig = loadBabelConfig(configDir);
// cacheDir is webpack babel loader specific. We don't run webpack.
delete babelConfig.cacheDirectory;
require('babel-register')(babelConfig);
require('babel-polyfill');
// load loaders
var loaders = require(path.resolve(loadersPath));
Object.keys(loaders).forEach(function(ext) {
var loader = loaders[ext];
require.extensions['.' + ext] = function(m, filepath) {
m.exports = loader(filepath);
};
});