How to use with expo-constants on web? #274
Answered
by
AllanChain
AllanChain
asked this question in
Q&A
-
When using this plugin, I can't access properties of That's because expo web uses webpack Code:
module.exports = function(api) {
api.cache(true);
return {
presets: ['babel-preset-expo'],
plugins: [
["module:react-native-dotenv"]
]
};
};
import { Text, View } from 'react-native';
import Constants from 'expo-constants'
export default function App() {
return (
<View>
<Text>Name: {Constants.manifest.name}</Text>
</View>
);
} The page should show app name, but it's empty after using this plugin. Is there any way to configure it to work with |
Beta Was this translation helpful? Give feedback.
Answered by
AllanChain
Jan 11, 2022
Replies: 1 comment 1 reply
-
I just realized that I can put it in module.exports = function (api) {
api.cache(true)
return {
presets: ['babel-preset-expo'],
overrides: [
{
test: (fileName) => !fileName.includes('node_modules'),
plugins: [
['module:react-native-dotenv']
]
}
]
}
} |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
AllanChain
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I just realized that I can put it in
overrides
: