mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-08-16 02:44:58 +00:00
feat: extract web example (#2333)
# Summary extract web-example from example app.
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
node_modules/
|
||||
.expo/
|
||||
dist/
|
||||
npm-debug.*
|
||||
*.jks
|
||||
*.p8
|
||||
*.p12
|
||||
*.key
|
||||
*.mobileprovision
|
||||
*.orig.*
|
||||
web-build/
|
||||
|
||||
# macOS
|
||||
.DS_Store
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
import App from '../apps/examples';
|
||||
|
||||
export default App;
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"expo": {
|
||||
"name": "web-example",
|
||||
"slug": "web-example",
|
||||
"version": "1.0.0",
|
||||
"web": {
|
||||
"favicon": "./assets/favicon.png"
|
||||
},
|
||||
"plugins": [
|
||||
"expo-asset"
|
||||
]
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 2.0 KiB |
@@ -0,0 +1,7 @@
|
||||
module.exports = function (api) {
|
||||
api.cache(true);
|
||||
return {
|
||||
presets: ['babel-preset-expo'],
|
||||
plugins: ['react-native-reanimated/plugin'],
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,10 @@
|
||||
import '@expo/metro-runtime';
|
||||
|
||||
import { registerRootComponent } from 'expo';
|
||||
|
||||
import App from './App';
|
||||
|
||||
// registerRootComponent calls AppRegistry.registerComponent('main', () => App);
|
||||
// It also ensures that whether you load the app in Expo Go or in a native build,
|
||||
// the environment is set up appropriately
|
||||
registerRootComponent(App);
|
||||
@@ -0,0 +1,30 @@
|
||||
// Learn more https://docs.expo.io/guides/customizing-metro
|
||||
const { getDefaultConfig } = require('expo/metro-config');
|
||||
const path = require('path');
|
||||
|
||||
const config = getDefaultConfig(__dirname);
|
||||
|
||||
// npm v7+ will install ../node_modules/react-native because of peerDependencies.
|
||||
// To prevent the incompatible react-native bewtween ./node_modules/react-native and ../node_modules/react-native,
|
||||
// excludes the one from the parent folder when bundling.
|
||||
config.resolver.blockList = [
|
||||
...Array.from(config.resolver.blockList ?? []),
|
||||
new RegExp(path.resolve('..', 'node_modules', 'react-native')),
|
||||
new RegExp(path.resolve('..', 'node_modules', 'react')),
|
||||
];
|
||||
|
||||
config.resolver.nodeModulesPaths = [
|
||||
path.resolve(__dirname, './node_modules'),
|
||||
path.resolve(__dirname, '../node_modules'),
|
||||
];
|
||||
|
||||
config.watchFolders = [path.resolve(__dirname, '..')];
|
||||
|
||||
config.transformer.getTransformOptions = async () => ({
|
||||
transform: {
|
||||
experimentalImportSupport: false,
|
||||
inlineRequires: true,
|
||||
},
|
||||
});
|
||||
|
||||
module.exports = config;
|
||||
@@ -0,0 +1,40 @@
|
||||
{
|
||||
"name": "web-example",
|
||||
"main": "index.js",
|
||||
"version": "0.0.1",
|
||||
"scripts": {
|
||||
"start": "expo start --web",
|
||||
"reset-project": "node ./scripts/reset-project.js",
|
||||
"test": "jest --watchAll",
|
||||
"lint": "expo lint"
|
||||
},
|
||||
"jest": {
|
||||
"preset": "jest-expo"
|
||||
},
|
||||
"dependencies": {
|
||||
"@expo/vector-icons": "^14.0.2",
|
||||
"@react-navigation/native": "^6.0.2",
|
||||
"expo": "~51.0.2",
|
||||
"expo-asset": "~10.0.10",
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0",
|
||||
"react-native": "0.74.0",
|
||||
"react-native-reanimated": "3.9.0-nightly-20240421-474f6983d",
|
||||
"react-native-svg": "link:../",
|
||||
"react-native-svg-transformer": "^1.4.0",
|
||||
"react-native-web": "0.19.11"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.20.0",
|
||||
"@expo/metro-runtime": "~3.2.1",
|
||||
"@react-native/metro-config": "^0.74.85",
|
||||
"@types/jest": "^29.5.12",
|
||||
"@types/react": "~18.2.45",
|
||||
"@types/react-test-renderer": "^18.0.7",
|
||||
"jest": "^29.2.1",
|
||||
"jest-expo": "~51.0.3",
|
||||
"react-test-renderer": "18.2.0",
|
||||
"typescript": "~5.3.3"
|
||||
},
|
||||
"private": true
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user