Skip to content
This repository has been archived by the owner on Sep 23, 2021. It is now read-only.

Commit

Permalink
Update metro config to support loading .cjs files
Browse files Browse the repository at this point in the history
Workaround for metro deficiency: facebook/metro#535

Caused by stylis shipping a .cjs file: thysultan/stylis#233

Fix from emotion-js/emotion#1986
  • Loading branch information
voidrender committed Sep 2, 2020
1 parent 9fde0ab commit 3d89558
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions metro.config.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
/**
* Metro configuration for React Native
* https://github.com/facebook/react-native
*
* @format
*/
const { getDefaultConfig } = require('metro-config');

module.exports = {
transformer: {
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: false,
},
}),
},
};
module.exports = (async () => {
const {
resolver: { sourceExts },
} = await getDefaultConfig();
return {
resolver: {
sourceExts: [...sourceExts, 'cjs'],
},
transformer: {
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: false,
},
}),
},
};
})();

0 comments on commit 3d89558

Please sign in to comment.