-
-
Save billyjanitsch/7f727bb217a6b233af4b to your computer and use it in GitHub Desktop.
Custom register hook
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// transform all imports with Babel | |
require('babel-core/register') | |
// include the environment polyfill | |
require('babel-polyfill') | |
// return empty objects for CSS imports | |
require.extensions['.scss'] = () => null | |
require.extensions['.css'] = () => null | |
// return empty strings for image imports | |
const emptyString = module => { | |
module.exports = '' | |
} | |
require.extensions['.svg'] = emptyString | |
require.extensions['.png'] = emptyString | |
// hijack console.error to throw | |
console.error = error => { | |
throw new Error(error) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment