Skip to content

Instantly share code, notes, and snippets.

@varHarrie
Created July 24, 2018 02:01
Show Gist options
  • Save varHarrie/95bfc10c56953ac322e7f84a8663f306 to your computer and use it in GitHub Desktop.
Save varHarrie/95bfc10c56953ac322e7f84a8663f306 to your computer and use it in GitHub Desktop.
const rewire = require('react-app-rewired')
module.exports = function rewireEmotion (config, env) {
if (env === 'development') {
config = rewire.injectBabelPlugin(['emotion', { sourceMap: true, autoLabel: true, "labelFormat": "📦[filename]--[local]" }], config)
} else {
config = rewire.injectBabelPlugin(['emotion', { hoist: true }], config)
}
return config
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment