Created
April 28, 2021 00:07
-
-
Save marklawlor/9b9daf8a655d56fc98e3dc4e427c2f4e to your computer and use it in GitHub Desktop.
Moti + Storybook + React-Native-Web
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
const path = require("path"); | |
const { withUnimodules } = require("@expo/webpack-config/addons"); | |
module.exports = { | |
stories: ["../src/**/*.stories.@(ts|tsx|js|jsx)"], | |
webpackFinal: async (config) => { | |
return withUnimodules( | |
config, | |
{ | |
projectRoot: path.resolve(__dirname, "../"), | |
babel: { dangerouslyAddModulePathsToTranspile: ["moti"] }, | |
}, | |
{ | |
expoConfig: { | |
web: { | |
build: { | |
babel: { | |
use: { | |
options: { | |
babelrc: false, | |
configFile: true, | |
}, | |
}, | |
}, | |
}, | |
}, | |
}, | |
} | |
); | |
}, | |
}; |
It worked amazingly, thanks for sharing it 🙌
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you are getting a similar error to
can't import the named export 'children' from nonecmascript module
you need to add the lines below.Some versions of frame-motion use the .mjs file inside.