├── .github
└── workflows
│ └── publish.yml
├── .gitignore
├── .npmignore
├── .npmrc
├── Example
├── .buckconfig
├── .editorconfig
├── .eslintignore
├── .eslintrc.js
├── .gitattributes
├── .gitignore
├── .npmrc
├── .prettierrc.js
├── .watchmanconfig
├── README.md
├── ReadmeInfo
│ ├── charles-map-local.png
│ ├── charles-map-local.xml
│ └── effect.gif
├── __tests__
│ └── App-test.tsx
├── android
│ ├── app
│ │ ├── BUCK
│ │ ├── build.gradle
│ │ ├── build_defs.bzl
│ │ ├── debug.keystore
│ │ ├── proguard-rules.pro
│ │ └── src
│ │ │ ├── debug
│ │ │ ├── AndroidManifest.xml
│ │ │ └── java
│ │ │ │ └── com
│ │ │ │ └── rncodesplitdemo
│ │ │ │ └── ReactNativeFlipper.java
│ │ │ └── main
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── java
│ │ │ └── com
│ │ │ │ └── rncodesplitdemo
│ │ │ │ ├── MainActivity.java
│ │ │ │ └── MainApplication.java
│ │ │ └── res
│ │ │ ├── mipmap-hdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-mdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xhdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ └── values
│ │ │ ├── strings.xml
│ │ │ └── styles.xml
│ ├── build.gradle
│ ├── gradle.properties
│ ├── gradle
│ │ └── wrapper
│ │ │ ├── gradle-wrapper.jar
│ │ │ └── gradle-wrapper.properties
│ ├── gradlew
│ ├── gradlew.bat
│ └── settings.gradle
├── app.json
├── babel.config.js
├── dist
│ ├── buz.android.bundle
│ ├── buz.ios.bundle
│ └── chunks
│ │ ├── 80303a4a0e2143d651bf.bundle
│ │ └── 9ed88d8adfdacbbc158d.bundle
├── index.js
├── ios
│ ├── Podfile
│ ├── rnCodeSplitDemo.xcodeproj
│ │ ├── project.pbxproj
│ │ └── xcshareddata
│ │ │ └── xcschemes
│ │ │ └── rnCodeSplitDemo.xcscheme
│ ├── rnCodeSplitDemo.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ └── IDEWorkspaceChecks.plist
│ ├── rnCodeSplitDemo
│ │ ├── AppDelegate.h
│ │ ├── AppDelegate.m
│ │ ├── Images.xcassets
│ │ │ ├── AppIcon.appiconset
│ │ │ │ └── Contents.json
│ │ │ └── Contents.json
│ │ ├── Info.plist
│ │ ├── LaunchScreen.storyboard
│ │ └── main.m
│ └── rnCodeSplitDemoTests
│ │ ├── Info.plist
│ │ └── rnCodeSplitDemoTests.m
├── metro.config.js
├── package.json
├── public
│ └── dll
│ │ ├── _dll.android.bundle
│ │ ├── _dll.android.json
│ │ ├── _dll.ios.bundle
│ │ ├── _dll.ios.json
│ │ ├── _pre.android.json
│ │ └── _pre.ios.json
├── src
│ ├── App.tsx
│ ├── common
│ │ └── .gitkeep
│ ├── components
│ │ └── .gitkeep
│ ├── global.d.ts
│ ├── index.ts
│ ├── types
│ │ └── index.ts
│ └── views
│ │ ├── Bar
│ │ └── index.tsx
│ │ ├── Foo
│ │ └── index.tsx
│ │ └── Main
│ │ └── index.tsx
└── tsconfig.json
├── README.md
├── license
├── package.json
├── src
├── bin
│ ├── build.js
│ ├── clear.js
│ ├── index.js
│ ├── start.js
│ └── update.js
├── config
│ ├── baseConfig.js
│ ├── craeteMustConfig.js
│ └── dynamicImports.js
├── index.js
├── plugins
│ └── InjectVar.js
├── tpl
│ ├── chunkModuleIdToHashMap.js
│ └── wrapAsyncRequire.ejs
├── types
│ ├── BuildType.js
│ ├── Commands.js
│ ├── NodeEnv.js
│ ├── Platform.js
│ ├── index.js
│ └── relativeDllEntry.js
└── utils
│ ├── index.js
│ ├── isProduction.js
│ ├── output.js
│ ├── paths
│ ├── asyncRequireModulePath.js
│ ├── chunkModuleIdToHashMapPath.js
│ ├── dllEntryPath.js
│ └── index.js
│ └── replacePath.js
├── test
└── .gitkeep
└── yarn.lock
/.github/workflows/publish.yml:
--------------------------------------------------------------------------------
1 | on:
2 | push:
3 | # Sequence of patterns matched against refs/tags
4 | tags:
5 | - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
6 |
7 | jobs:
8 | publish:
9 | runs-on: ubuntu-latest
10 | steps:
11 | - name: Checkout Clone
12 | uses: actions/checkout@v2
13 | - name: Setup Node
14 | uses: actions/setup-node@v2
15 | with:
16 | node-version: '14'
17 | registry-url: 'https://registry.npmjs.org'
18 | # - name: Install # For now, send the source code directly
19 | # run: yarn install
20 | # - name: Build
21 | # run: npm run build
22 | - name: Create Release
23 | id: create_release
24 | uses: actions/create-release@v1
25 | env:
26 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
27 | with:
28 | tag_name: ${{ github.ref }}
29 | release_name: Release ${{ github.ref }} # Title
30 | draft: false
31 | prerelease: false
32 | - name: Publish
33 | run: npm publish
34 | env:
35 | NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
36 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 |
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | ~*
2 | # 优先级 package.json files (白名单) > .npmignore (黑名单) > .gitignore (黑名单)
3 | # 默认会提交的有 package.json main module 指向的文件 README.md等
4 |
--------------------------------------------------------------------------------
/.npmrc:
--------------------------------------------------------------------------------
1 | registry = https://registry.npmjs.org
2 |
--------------------------------------------------------------------------------
/Example/.buckconfig:
--------------------------------------------------------------------------------
1 |
2 | [android]
3 | target = Google Inc.:Google APIs:23
4 |
5 | [maven_repositories]
6 | central = https://repo1.maven.org/maven2
7 |
--------------------------------------------------------------------------------
/Example/.editorconfig:
--------------------------------------------------------------------------------
1 | # Windows files
2 | [*.bat]
3 | end_of_line = crlf
4 |
--------------------------------------------------------------------------------
/Example/.eslintignore:
--------------------------------------------------------------------------------
1 |
2 | node_modules/*
3 | bower_components/*
4 |
5 | # 自定义
6 | __tests__/*
7 | ios/*
8 | android/*
9 | dist/*
10 | build/*
11 | scripts/*
12 |
--------------------------------------------------------------------------------
/Example/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | root: true,
3 | extends: '@react-native-community',
4 | parser: '@typescript-eslint/parser',
5 | plugins: ['@typescript-eslint'],
6 | rules: {
7 | semi: [1, 'never'],
8 | 'prettier/prettier': 0, // prettier 只用作格式化
9 | 'react-native/no-inline-styles': 0, // 可以使用内联样式
10 | // 'comma-dangle': [1, 'only-multiline'], // 尾随逗号 允许(但不要求)多行可加可不加 单行不允许
11 | // 'no-return-assign': 0, // 函数不应该返回赋值 仅仅是为了更简洁
12 | // 'react/prop-types': 0, // 有了ts以后 不强制使用prop-types来校验
13 | // '@typescript-eslint/ban-ts-ignore': 0, // 禁止使用 @ts-ignore
14 | // '@typescript-eslint/no-empty-function': 0, // 不允许空函数 noop 一些默认的空函数
15 | // '@typescript-eslint/explicit-function-return-type': 0, // 要求函数和类方法的显式返回类型 (有些 是可以使用类型推断 省略的)
16 | // '@typescript-eslint/no-explicit-any': 0, // 禁止使用该any类型
17 | },
18 | }
19 |
--------------------------------------------------------------------------------
/Example/.gitattributes:
--------------------------------------------------------------------------------
1 | # Windows files should use crlf line endings
2 | # https://help.github.com/articles/dealing-with-line-endings/
3 | *.bat text eol=crlf
4 |
--------------------------------------------------------------------------------
/Example/.gitignore:
--------------------------------------------------------------------------------
1 | # OSX
2 | #
3 | .DS_Store
4 |
5 | # Xcode
6 | #
7 | build/
8 | *.pbxuser
9 | !default.pbxuser
10 | *.mode1v3
11 | !default.mode1v3
12 | *.mode2v3
13 | !default.mode2v3
14 | *.perspectivev3
15 | !default.perspectivev3
16 | xcuserdata
17 | *.xccheckout
18 | *.moved-aside
19 | DerivedData
20 | *.hmap
21 | *.ipa
22 | *.xcuserstate
23 |
24 | # Android/IntelliJ
25 | #
26 | build/
27 | .idea
28 | .gradle
29 | local.properties
30 | *.iml
31 |
32 | # node.js
33 | #
34 | node_modules/
35 | npm-debug.log
36 | yarn-error.log
37 |
38 | # BUCK
39 | buck-out/
40 | \.buckd/
41 | *.keystore
42 | !debug.keystore
43 |
44 | # fastlane
45 | #
46 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
47 | # screenshots whenever they are needed.
48 | # For more information about the recommended setup visit:
49 | # https://docs.fastlane.tools/best-practices/source-control/
50 |
51 | */fastlane/report.xml
52 | */fastlane/Preview.html
53 | */fastlane/screenshots
54 |
55 | # Bundle artifact
56 | *.jsbundle
57 |
58 | # CocoaPods
59 | /ios/Pods/
60 |
61 | # The custom
62 | # dist/
63 | # build/
64 |
65 |
--------------------------------------------------------------------------------
/Example/.npmrc:
--------------------------------------------------------------------------------
1 | registry = https://registry.npmjs.org
2 |
--------------------------------------------------------------------------------
/Example/.prettierrc.js:
--------------------------------------------------------------------------------
1 | // https://prettier.io/docs/en/configuration.html
2 |
3 | module.exports = {
4 | trailingComma: 'es5', // 在ES5中有效的结尾逗号(对象,数组等)
5 | tabWidth: 2, // 缩进级别的空格数
6 | semi: false, // 每行末尾不加分号
7 | singleQuote: true // 使用单引号
8 | }
9 |
--------------------------------------------------------------------------------
/Example/.watchmanconfig:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/Example/README.md:
--------------------------------------------------------------------------------
1 | # rn-code-split-demo
2 |
3 | The project is based on the official template, using the metro-code-split to implement the react-native code split example
4 |
5 | ## Test the load logic step(only demonstrate the ios)
6 |
7 | 1. yarn && cd ios && pod install // install dependencies
8 |
9 | 2. Use charles to simulate the load of business resources
10 |
11 | - [import charles map local file](./ReadmeInfo/charles-map-local.xml)
12 |
13 |
14 |
15 |
16 |
17 | - **Tip: Make sure the iOS Simulator has a charles certificate installed**
18 |
19 | 3. npm run ios or Using Xcode opens the ios/rnCodeSplitDemo.xcworkspace click run
20 |
21 | - **Tip: manually merge \_dl.ios.bundle into buz.ios.bundle for test convenience (should be built into App in production)**
22 |
23 | ## Effect
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/Example/ReadmeInfo/charles-map-local.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wuba/metro-code-split/933a70acbf2b6a8d694bbcdcdd5a24c9bb14cc99/Example/ReadmeInfo/charles-map-local.png
--------------------------------------------------------------------------------
/Example/ReadmeInfo/charles-map-local.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | true
5 |
6 |
7 |
8 | https
9 | github.githubassets.com
10 | 443
11 | /a-rn-project/*
12 |
13 | /Users/xxx/rn-code-split-demo/dist
14 | true
15 | true
16 |
17 |
18 |
--------------------------------------------------------------------------------
/Example/ReadmeInfo/effect.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wuba/metro-code-split/933a70acbf2b6a8d694bbcdcdd5a24c9bb14cc99/Example/ReadmeInfo/effect.gif
--------------------------------------------------------------------------------
/Example/__tests__/App-test.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * @format
3 | */
4 |
5 | import 'react-native';
6 | import React from 'react';
7 | import App from '../App';
8 |
9 | // Note: test renderer must be required after react-native.
10 | import renderer from 'react-test-renderer';
11 |
12 | it('renders correctly', () => {
13 | renderer.create( );
14 | });
15 |
--------------------------------------------------------------------------------
/Example/android/app/BUCK:
--------------------------------------------------------------------------------
1 | # To learn about Buck see [Docs](https://buckbuild.com/).
2 | # To run your application with Buck:
3 | # - install Buck
4 | # - `npm start` - to start the packager
5 | # - `cd android`
6 | # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"`
7 | # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck
8 | # - `buck install -r android/app` - compile, install and run application
9 | #
10 |
11 | load(":build_defs.bzl", "create_aar_targets", "create_jar_targets")
12 |
13 | lib_deps = []
14 |
15 | create_aar_targets(glob(["libs/*.aar"]))
16 |
17 | create_jar_targets(glob(["libs/*.jar"]))
18 |
19 | android_library(
20 | name = "all-libs",
21 | exported_deps = lib_deps,
22 | )
23 |
24 | android_library(
25 | name = "app-code",
26 | srcs = glob([
27 | "src/main/java/**/*.java",
28 | ]),
29 | deps = [
30 | ":all-libs",
31 | ":build_config",
32 | ":res",
33 | ],
34 | )
35 |
36 | android_build_config(
37 | name = "build_config",
38 | package = "com.rncodesplitdemo",
39 | )
40 |
41 | android_resource(
42 | name = "res",
43 | package = "com.rncodesplitdemo",
44 | res = "src/main/res",
45 | )
46 |
47 | android_binary(
48 | name = "app",
49 | keystore = "//android/keystores:debug",
50 | manifest = "src/main/AndroidManifest.xml",
51 | package_type = "debug",
52 | deps = [
53 | ":app-code",
54 | ],
55 | )
56 |
--------------------------------------------------------------------------------
/Example/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: "com.android.application"
2 |
3 | import com.android.build.OutputFile
4 |
5 | /**
6 | * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
7 | * and bundleReleaseJsAndAssets).
8 | * These basically call `react-native bundle` with the correct arguments during the Android build
9 | * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
10 | * bundle directly from the development server. Below you can see all the possible configurations
11 | * and their defaults. If you decide to add a configuration block, make sure to add it before the
12 | * `apply from: "../../node_modules/react-native/react.gradle"` line.
13 | *
14 | * project.ext.react = [
15 | * // the name of the generated asset file containing your JS bundle
16 | * bundleAssetName: "index.android.bundle",
17 | *
18 | * // the entry file for bundle generation. If none specified and
19 | * // "index.android.js" exists, it will be used. Otherwise "index.js" is
20 | * // default. Can be overridden with ENTRY_FILE environment variable.
21 | * entryFile: "index.android.js",
22 | *
23 | * // https://reactnative.dev/docs/performance#enable-the-ram-format
24 | * bundleCommand: "ram-bundle",
25 | *
26 | * // whether to bundle JS and assets in debug mode
27 | * bundleInDebug: false,
28 | *
29 | * // whether to bundle JS and assets in release mode
30 | * bundleInRelease: true,
31 | *
32 | * // whether to bundle JS and assets in another build variant (if configured).
33 | * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
34 | * // The configuration property can be in the following formats
35 | * // 'bundleIn${productFlavor}${buildType}'
36 | * // 'bundleIn${buildType}'
37 | * // bundleInFreeDebug: true,
38 | * // bundleInPaidRelease: true,
39 | * // bundleInBeta: true,
40 | *
41 | * // whether to disable dev mode in custom build variants (by default only disabled in release)
42 | * // for example: to disable dev mode in the staging build type (if configured)
43 | * devDisabledInStaging: true,
44 | * // The configuration property can be in the following formats
45 | * // 'devDisabledIn${productFlavor}${buildType}'
46 | * // 'devDisabledIn${buildType}'
47 | *
48 | * // the root of your project, i.e. where "package.json" lives
49 | * root: "../../",
50 | *
51 | * // where to put the JS bundle asset in debug mode
52 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
53 | *
54 | * // where to put the JS bundle asset in release mode
55 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release",
56 | *
57 | * // where to put drawable resources / React Native assets, e.g. the ones you use via
58 | * // require('./image.png')), in debug mode
59 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
60 | *
61 | * // where to put drawable resources / React Native assets, e.g. the ones you use via
62 | * // require('./image.png')), in release mode
63 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
64 | *
65 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means
66 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
67 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle
68 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
69 | * // for example, you might want to remove it from here.
70 | * inputExcludes: ["android/**", "ios/**"],
71 | *
72 | * // override which node gets called and with what additional arguments
73 | * nodeExecutableAndArgs: ["node"],
74 | *
75 | * // supply additional arguments to the packager
76 | * extraPackagerArgs: []
77 | * ]
78 | */
79 |
80 | project.ext.react = [
81 | enableHermes: false, // clean and rebuild if changing
82 | ]
83 |
84 | apply from: "../../node_modules/react-native/react.gradle"
85 |
86 | /**
87 | * Set this to true to create two separate APKs instead of one:
88 | * - An APK that only works on ARM devices
89 | * - An APK that only works on x86 devices
90 | * The advantage is the size of the APK is reduced by about 4MB.
91 | * Upload all the APKs to the Play Store and people will download
92 | * the correct one based on the CPU architecture of their device.
93 | */
94 | def enableSeparateBuildPerCPUArchitecture = false
95 |
96 | /**
97 | * Run Proguard to shrink the Java bytecode in release builds.
98 | */
99 | def enableProguardInReleaseBuilds = false
100 |
101 | /**
102 | * The preferred build flavor of JavaScriptCore.
103 | *
104 | * For example, to use the international variant, you can use:
105 | * `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
106 | *
107 | * The international variant includes ICU i18n library and necessary data
108 | * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
109 | * give correct results when using with locales other than en-US. Note that
110 | * this variant is about 6MiB larger per architecture than default.
111 | */
112 | def jscFlavor = 'org.webkit:android-jsc:+'
113 |
114 | /**
115 | * Whether to enable the Hermes VM.
116 | *
117 | * This should be set on project.ext.react and mirrored here. If it is not set
118 | * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode
119 | * and the benefits of using Hermes will therefore be sharply reduced.
120 | */
121 | def enableHermes = project.ext.react.get("enableHermes", false);
122 |
123 | android {
124 | ndkVersion rootProject.ext.ndkVersion
125 |
126 | compileSdkVersion rootProject.ext.compileSdkVersion
127 |
128 | compileOptions {
129 | sourceCompatibility JavaVersion.VERSION_1_8
130 | targetCompatibility JavaVersion.VERSION_1_8
131 | }
132 |
133 | defaultConfig {
134 | applicationId "com.rncodesplitdemo"
135 | minSdkVersion rootProject.ext.minSdkVersion
136 | targetSdkVersion rootProject.ext.targetSdkVersion
137 | versionCode 1
138 | versionName "1.0"
139 | }
140 | splits {
141 | abi {
142 | reset()
143 | enable enableSeparateBuildPerCPUArchitecture
144 | universalApk false // If true, also generate a universal APK
145 | include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
146 | }
147 | }
148 | signingConfigs {
149 | debug {
150 | storeFile file('debug.keystore')
151 | storePassword 'android'
152 | keyAlias 'androiddebugkey'
153 | keyPassword 'android'
154 | }
155 | }
156 | buildTypes {
157 | debug {
158 | signingConfig signingConfigs.debug
159 | }
160 | release {
161 | // Caution! In production, you need to generate your own keystore file.
162 | // see https://reactnative.dev/docs/signed-apk-android.
163 | signingConfig signingConfigs.debug
164 | minifyEnabled enableProguardInReleaseBuilds
165 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
166 | }
167 | }
168 |
169 | // applicationVariants are e.g. debug, release
170 | applicationVariants.all { variant ->
171 | variant.outputs.each { output ->
172 | // For each separate APK per architecture, set a unique version code as described here:
173 | // https://developer.android.com/studio/build/configure-apk-splits.html
174 | // Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc.
175 | def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
176 | def abi = output.getFilter(OutputFile.ABI)
177 | if (abi != null) { // null for the universal-debug, universal-release variants
178 | output.versionCodeOverride =
179 | defaultConfig.versionCode * 1000 + versionCodes.get(abi)
180 | }
181 |
182 | }
183 | }
184 | }
185 |
186 | dependencies {
187 | implementation fileTree(dir: "libs", include: ["*.jar"])
188 | //noinspection GradleDynamicVersion
189 | implementation "com.facebook.react:react-native:+" // From node_modules
190 |
191 | implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
192 |
193 | debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
194 | exclude group:'com.facebook.fbjni'
195 | }
196 |
197 | debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
198 | exclude group:'com.facebook.flipper'
199 | exclude group:'com.squareup.okhttp3', module:'okhttp'
200 | }
201 |
202 | debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
203 | exclude group:'com.facebook.flipper'
204 | }
205 |
206 | if (enableHermes) {
207 | def hermesPath = "../../node_modules/hermes-engine/android/";
208 | debugImplementation files(hermesPath + "hermes-debug.aar")
209 | releaseImplementation files(hermesPath + "hermes-release.aar")
210 | } else {
211 | implementation jscFlavor
212 | }
213 | }
214 |
215 | // Run this once to be able to run the application with BUCK
216 | // puts all compile dependencies into folder libs for BUCK to use
217 | task copyDownloadableDepsToLibs(type: Copy) {
218 | from configurations.compile
219 | into 'libs'
220 | }
221 |
222 | apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
223 |
--------------------------------------------------------------------------------
/Example/android/app/build_defs.bzl:
--------------------------------------------------------------------------------
1 | """Helper definitions to glob .aar and .jar targets"""
2 |
3 | def create_aar_targets(aarfiles):
4 | for aarfile in aarfiles:
5 | name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")]
6 | lib_deps.append(":" + name)
7 | android_prebuilt_aar(
8 | name = name,
9 | aar = aarfile,
10 | )
11 |
12 | def create_jar_targets(jarfiles):
13 | for jarfile in jarfiles:
14 | name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")]
15 | lib_deps.append(":" + name)
16 | prebuilt_jar(
17 | name = name,
18 | binary_jar = jarfile,
19 | )
20 |
--------------------------------------------------------------------------------
/Example/android/app/debug.keystore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wuba/metro-code-split/933a70acbf2b6a8d694bbcdcdd5a24c9bb14cc99/Example/android/app/debug.keystore
--------------------------------------------------------------------------------
/Example/android/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
--------------------------------------------------------------------------------
/Example/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/Example/android/app/src/debug/java/com/rncodesplitdemo/ReactNativeFlipper.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the LICENSE file in the root
5 | * directory of this source tree.
6 | */
7 | package com.rncodesplitdemo;
8 |
9 | import android.content.Context;
10 | import com.facebook.flipper.android.AndroidFlipperClient;
11 | import com.facebook.flipper.android.utils.FlipperUtils;
12 | import com.facebook.flipper.core.FlipperClient;
13 | import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin;
14 | import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin;
15 | import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin;
16 | import com.facebook.flipper.plugins.inspector.DescriptorMapping;
17 | import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin;
18 | import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor;
19 | import com.facebook.flipper.plugins.network.NetworkFlipperPlugin;
20 | import com.facebook.flipper.plugins.react.ReactFlipperPlugin;
21 | import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin;
22 | import com.facebook.react.ReactInstanceManager;
23 | import com.facebook.react.bridge.ReactContext;
24 | import com.facebook.react.modules.network.NetworkingModule;
25 | import okhttp3.OkHttpClient;
26 |
27 | public class ReactNativeFlipper {
28 | public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
29 | if (FlipperUtils.shouldEnableFlipper(context)) {
30 | final FlipperClient client = AndroidFlipperClient.getInstance(context);
31 |
32 | client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()));
33 | client.addPlugin(new ReactFlipperPlugin());
34 | client.addPlugin(new DatabasesFlipperPlugin(context));
35 | client.addPlugin(new SharedPreferencesFlipperPlugin(context));
36 | client.addPlugin(CrashReporterPlugin.getInstance());
37 |
38 | NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin();
39 | NetworkingModule.setCustomClientBuilder(
40 | new NetworkingModule.CustomClientBuilder() {
41 | @Override
42 | public void apply(OkHttpClient.Builder builder) {
43 | builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin));
44 | }
45 | });
46 | client.addPlugin(networkFlipperPlugin);
47 | client.start();
48 |
49 | // Fresco Plugin needs to ensure that ImagePipelineFactory is initialized
50 | // Hence we run if after all native modules have been initialized
51 | ReactContext reactContext = reactInstanceManager.getCurrentReactContext();
52 | if (reactContext == null) {
53 | reactInstanceManager.addReactInstanceEventListener(
54 | new ReactInstanceManager.ReactInstanceEventListener() {
55 | @Override
56 | public void onReactContextInitialized(ReactContext reactContext) {
57 | reactInstanceManager.removeReactInstanceEventListener(this);
58 | reactContext.runOnNativeModulesQueueThread(
59 | new Runnable() {
60 | @Override
61 | public void run() {
62 | client.addPlugin(new FrescoFlipperPlugin());
63 | }
64 | });
65 | }
66 | });
67 | } else {
68 | client.addPlugin(new FrescoFlipperPlugin());
69 | }
70 | }
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/Example/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
13 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Example/android/app/src/main/java/com/rncodesplitdemo/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.rncodesplitdemo;
2 |
3 | import com.facebook.react.ReactActivity;
4 |
5 | public class MainActivity extends ReactActivity {
6 |
7 | /**
8 | * Returns the name of the main component registered from JavaScript. This is used to schedule
9 | * rendering of the component.
10 | */
11 | @Override
12 | protected String getMainComponentName() {
13 | return "rnCodeSplitDemo";
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Example/android/app/src/main/java/com/rncodesplitdemo/MainApplication.java:
--------------------------------------------------------------------------------
1 | package com.rncodesplitdemo;
2 |
3 | import android.app.Application;
4 | import android.content.Context;
5 | import com.facebook.react.PackageList;
6 | import com.facebook.react.ReactApplication;
7 | import com.facebook.react.ReactInstanceManager;
8 | import com.facebook.react.ReactNativeHost;
9 | import com.facebook.react.ReactPackage;
10 | import com.facebook.soloader.SoLoader;
11 | import java.lang.reflect.InvocationTargetException;
12 | import java.util.List;
13 |
14 | public class MainApplication extends Application implements ReactApplication {
15 |
16 | private final ReactNativeHost mReactNativeHost =
17 | new ReactNativeHost(this) {
18 | @Override
19 | public boolean getUseDeveloperSupport() {
20 | return BuildConfig.DEBUG;
21 | }
22 |
23 | @Override
24 | protected List getPackages() {
25 | @SuppressWarnings("UnnecessaryLocalVariable")
26 | List packages = new PackageList(this).getPackages();
27 | // Packages that cannot be autolinked yet can be added manually here, for example:
28 | // packages.add(new MyReactNativePackage());
29 | return packages;
30 | }
31 |
32 | @Override
33 | protected String getJSMainModuleName() {
34 | return "index";
35 | }
36 | };
37 |
38 | @Override
39 | public ReactNativeHost getReactNativeHost() {
40 | return mReactNativeHost;
41 | }
42 |
43 | @Override
44 | public void onCreate() {
45 | super.onCreate();
46 | SoLoader.init(this, /* native exopackage */ false);
47 | initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
48 | }
49 |
50 | /**
51 | * Loads Flipper in React Native templates. Call this in the onCreate method with something like
52 | * initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
53 | *
54 | * @param context
55 | * @param reactInstanceManager
56 | */
57 | private static void initializeFlipper(
58 | Context context, ReactInstanceManager reactInstanceManager) {
59 | if (BuildConfig.DEBUG) {
60 | try {
61 | /*
62 | We use reflection here to pick up the class that initializes Flipper,
63 | since Flipper library is not available in release mode
64 | */
65 | Class> aClass = Class.forName("com.rncodesplitdemo.ReactNativeFlipper");
66 | aClass
67 | .getMethod("initializeFlipper", Context.class, ReactInstanceManager.class)
68 | .invoke(null, context, reactInstanceManager);
69 | } catch (ClassNotFoundException e) {
70 | e.printStackTrace();
71 | } catch (NoSuchMethodException e) {
72 | e.printStackTrace();
73 | } catch (IllegalAccessException e) {
74 | e.printStackTrace();
75 | } catch (InvocationTargetException e) {
76 | e.printStackTrace();
77 | }
78 | }
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/Example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wuba/metro-code-split/933a70acbf2b6a8d694bbcdcdd5a24c9bb14cc99/Example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wuba/metro-code-split/933a70acbf2b6a8d694bbcdcdd5a24c9bb14cc99/Example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wuba/metro-code-split/933a70acbf2b6a8d694bbcdcdd5a24c9bb14cc99/Example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wuba/metro-code-split/933a70acbf2b6a8d694bbcdcdd5a24c9bb14cc99/Example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wuba/metro-code-split/933a70acbf2b6a8d694bbcdcdd5a24c9bb14cc99/Example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wuba/metro-code-split/933a70acbf2b6a8d694bbcdcdd5a24c9bb14cc99/Example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wuba/metro-code-split/933a70acbf2b6a8d694bbcdcdd5a24c9bb14cc99/Example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wuba/metro-code-split/933a70acbf2b6a8d694bbcdcdd5a24c9bb14cc99/Example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wuba/metro-code-split/933a70acbf2b6a8d694bbcdcdd5a24c9bb14cc99/Example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wuba/metro-code-split/933a70acbf2b6a8d694bbcdcdd5a24c9bb14cc99/Example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Example/android/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | rnCodeSplitDemo
3 |
4 |
--------------------------------------------------------------------------------
/Example/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Example/android/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | ext {
5 | buildToolsVersion = "29.0.3"
6 | minSdkVersion = 21
7 | compileSdkVersion = 29
8 | targetSdkVersion = 29
9 | ndkVersion = "20.1.5948944"
10 | }
11 | repositories {
12 | google()
13 | jcenter()
14 | }
15 | dependencies {
16 | classpath("com.android.tools.build:gradle:4.1.0")
17 | // NOTE: Do not place your application dependencies here; they belong
18 | // in the individual module build.gradle files
19 | }
20 | }
21 |
22 | allprojects {
23 | repositories {
24 | mavenLocal()
25 | maven {
26 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
27 | url("$rootDir/../node_modules/react-native/android")
28 | }
29 | maven {
30 | // Android JSC is installed from npm
31 | url("$rootDir/../node_modules/jsc-android/dist")
32 | }
33 |
34 | google()
35 | jcenter()
36 | maven { url 'https://www.jitpack.io' }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/Example/android/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
19 |
20 | # AndroidX package structure to make it clearer which packages are bundled with the
21 | # Android operating system, and which are packaged with your app's APK
22 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
23 | android.useAndroidX=true
24 | # Automatically convert third-party libraries to use AndroidX
25 | android.enableJetifier=true
26 |
27 | # Version of flipper SDK to use with React Native
28 | FLIPPER_VERSION=0.75.1
29 |
--------------------------------------------------------------------------------
/Example/android/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wuba/metro-code-split/933a70acbf2b6a8d694bbcdcdd5a24c9bb14cc99/Example/android/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/Example/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 |
--------------------------------------------------------------------------------
/Example/android/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | #
4 | # Copyright 2015 the original author or authors.
5 | #
6 | # Licensed under the Apache License, Version 2.0 (the "License");
7 | # you may not use this file except in compliance with the License.
8 | # You may obtain a copy of the License at
9 | #
10 | # https://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 | #
18 |
19 | ##############################################################################
20 | ##
21 | ## Gradle start up script for UN*X
22 | ##
23 | ##############################################################################
24 |
25 | # Attempt to set APP_HOME
26 | # Resolve links: $0 may be a link
27 | PRG="$0"
28 | # Need this for relative symlinks.
29 | while [ -h "$PRG" ] ; do
30 | ls=`ls -ld "$PRG"`
31 | link=`expr "$ls" : '.*-> \(.*\)$'`
32 | if expr "$link" : '/.*' > /dev/null; then
33 | PRG="$link"
34 | else
35 | PRG=`dirname "$PRG"`"/$link"
36 | fi
37 | done
38 | SAVED="`pwd`"
39 | cd "`dirname \"$PRG\"`/" >/dev/null
40 | APP_HOME="`pwd -P`"
41 | cd "$SAVED" >/dev/null
42 |
43 | APP_NAME="Gradle"
44 | APP_BASE_NAME=`basename "$0"`
45 |
46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
48 |
49 | # Use the maximum available, or set MAX_FD != -1 to use that value.
50 | MAX_FD="maximum"
51 |
52 | warn () {
53 | echo "$*"
54 | }
55 |
56 | die () {
57 | echo
58 | echo "$*"
59 | echo
60 | exit 1
61 | }
62 |
63 | # OS specific support (must be 'true' or 'false').
64 | cygwin=false
65 | msys=false
66 | darwin=false
67 | nonstop=false
68 | case "`uname`" in
69 | CYGWIN* )
70 | cygwin=true
71 | ;;
72 | Darwin* )
73 | darwin=true
74 | ;;
75 | MINGW* )
76 | msys=true
77 | ;;
78 | NONSTOP* )
79 | nonstop=true
80 | ;;
81 | esac
82 |
83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
84 |
85 |
86 | # Determine the Java command to use to start the JVM.
87 | if [ -n "$JAVA_HOME" ] ; then
88 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
89 | # IBM's JDK on AIX uses strange locations for the executables
90 | JAVACMD="$JAVA_HOME/jre/sh/java"
91 | else
92 | JAVACMD="$JAVA_HOME/bin/java"
93 | fi
94 | if [ ! -x "$JAVACMD" ] ; then
95 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
96 |
97 | Please set the JAVA_HOME variable in your environment to match the
98 | location of your Java installation."
99 | fi
100 | else
101 | JAVACMD="java"
102 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
103 |
104 | Please set the JAVA_HOME variable in your environment to match the
105 | location of your Java installation."
106 | fi
107 |
108 | # Increase the maximum file descriptors if we can.
109 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
110 | MAX_FD_LIMIT=`ulimit -H -n`
111 | if [ $? -eq 0 ] ; then
112 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
113 | MAX_FD="$MAX_FD_LIMIT"
114 | fi
115 | ulimit -n $MAX_FD
116 | if [ $? -ne 0 ] ; then
117 | warn "Could not set maximum file descriptor limit: $MAX_FD"
118 | fi
119 | else
120 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
121 | fi
122 | fi
123 |
124 | # For Darwin, add options to specify how the application appears in the dock
125 | if $darwin; then
126 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
127 | fi
128 |
129 | # For Cygwin or MSYS, switch paths to Windows format before running java
130 | if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
131 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
132 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
133 |
134 | JAVACMD=`cygpath --unix "$JAVACMD"`
135 |
136 | # We build the pattern for arguments to be converted via cygpath
137 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
138 | SEP=""
139 | for dir in $ROOTDIRSRAW ; do
140 | ROOTDIRS="$ROOTDIRS$SEP$dir"
141 | SEP="|"
142 | done
143 | OURCYGPATTERN="(^($ROOTDIRS))"
144 | # Add a user-defined pattern to the cygpath arguments
145 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
146 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
147 | fi
148 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
149 | i=0
150 | for arg in "$@" ; do
151 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
152 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
153 |
154 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
155 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
156 | else
157 | eval `echo args$i`="\"$arg\""
158 | fi
159 | i=`expr $i + 1`
160 | done
161 | case $i in
162 | 0) set -- ;;
163 | 1) set -- "$args0" ;;
164 | 2) set -- "$args0" "$args1" ;;
165 | 3) set -- "$args0" "$args1" "$args2" ;;
166 | 4) set -- "$args0" "$args1" "$args2" "$args3" ;;
167 | 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
168 | 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
169 | 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
170 | 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
171 | 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
172 | esac
173 | fi
174 |
175 | # Escape application args
176 | save () {
177 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
178 | echo " "
179 | }
180 | APP_ARGS=`save "$@"`
181 |
182 | # Collect all arguments for the java command, following the shell quoting and substitution rules
183 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
184 |
185 | exec "$JAVACMD" "$@"
186 |
--------------------------------------------------------------------------------
/Example/android/gradlew.bat:
--------------------------------------------------------------------------------
1 | @rem
2 | @rem Copyright 2015 the original author or authors.
3 | @rem
4 | @rem Licensed under the Apache License, Version 2.0 (the "License");
5 | @rem you may not use this file except in compliance with the License.
6 | @rem You may obtain a copy of the License at
7 | @rem
8 | @rem https://www.apache.org/licenses/LICENSE-2.0
9 | @rem
10 | @rem Unless required by applicable law or agreed to in writing, software
11 | @rem distributed under the License is distributed on an "AS IS" BASIS,
12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | @rem See the License for the specific language governing permissions and
14 | @rem limitations under the License.
15 | @rem
16 |
17 | @if "%DEBUG%" == "" @echo off
18 | @rem ##########################################################################
19 | @rem
20 | @rem Gradle startup script for Windows
21 | @rem
22 | @rem ##########################################################################
23 |
24 | @rem Set local scope for the variables with windows NT shell
25 | if "%OS%"=="Windows_NT" setlocal
26 |
27 | set DIRNAME=%~dp0
28 | if "%DIRNAME%" == "" set DIRNAME=.
29 | set APP_BASE_NAME=%~n0
30 | set APP_HOME=%DIRNAME%
31 |
32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter.
33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
34 |
35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
37 |
38 | @rem Find java.exe
39 | if defined JAVA_HOME goto findJavaFromJavaHome
40 |
41 | set JAVA_EXE=java.exe
42 | %JAVA_EXE% -version >NUL 2>&1
43 | if "%ERRORLEVEL%" == "0" goto execute
44 |
45 | echo.
46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
47 | echo.
48 | echo Please set the JAVA_HOME variable in your environment to match the
49 | echo location of your Java installation.
50 |
51 | goto fail
52 |
53 | :findJavaFromJavaHome
54 | set JAVA_HOME=%JAVA_HOME:"=%
55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
56 |
57 | if exist "%JAVA_EXE%" goto execute
58 |
59 | echo.
60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
61 | echo.
62 | echo Please set the JAVA_HOME variable in your environment to match the
63 | echo location of your Java installation.
64 |
65 | goto fail
66 |
67 | :execute
68 | @rem Setup the command line
69 |
70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
71 |
72 |
73 | @rem Execute Gradle
74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
75 |
76 | :end
77 | @rem End local scope for the variables with windows NT shell
78 | if "%ERRORLEVEL%"=="0" goto mainEnd
79 |
80 | :fail
81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
82 | rem the _cmd.exe /c_ return code!
83 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
84 | exit /b 1
85 |
86 | :mainEnd
87 | if "%OS%"=="Windows_NT" endlocal
88 |
89 | :omega
90 |
--------------------------------------------------------------------------------
/Example/android/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'rnCodeSplitDemo'
2 | apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
3 | include ':app'
4 |
--------------------------------------------------------------------------------
/Example/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "rnCodeSplitDemo",
3 | "displayName": "rnCodeSplitDemo"
4 | }
--------------------------------------------------------------------------------
/Example/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: ['module:metro-react-native-babel-preset'],
3 | plugins: [
4 | ['@babel/plugin-proposal-decorators', { legacy: true }], // 装饰器语法支持
5 | ],
6 | }
7 |
--------------------------------------------------------------------------------
/Example/dist/chunks/80303a4a0e2143d651bf.bundle:
--------------------------------------------------------------------------------
1 | __d(function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=r(d[0])(r(d[1])),l=r(d[2]),o=l.StyleSheet.create({SafeAreaView:{flex:1,borderWidth:3,borderColor:'red'},View:{flex:1,justifyContent:'center',alignItems:'center'},Text:{color:'red',fontSize:40}}),n=function(n){var f=n.route;return console.log(f.params.userId),t.default.createElement(l.SafeAreaView,{style:o.SafeAreaView},t.default.createElement(l.View,{style:o.View},t.default.createElement(l.Text,{style:o.Text},"Bar \u9875\u9762")))};e.default=n},"src/views/Bar/index.tsx",["node_modules/@babel/runtime/helpers/interopRequireDefault.js","node_modules/react/index.js","node_modules/react-native/index.js"]);
--------------------------------------------------------------------------------
/Example/dist/chunks/9ed88d8adfdacbbc158d.bundle:
--------------------------------------------------------------------------------
1 | __d(function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=r(d[0])(r(d[1])),l=r(d[2]),f=l.StyleSheet.create({SafeAreaView:{flex:1,borderWidth:3,borderColor:'blue'},View:{flex:1,justifyContent:'center',alignItems:'center'},Text:{color:'blue',fontSize:40}}),n=function(){return t.default.createElement(l.SafeAreaView,{style:f.SafeAreaView},t.default.createElement(l.View,{style:f.View},t.default.createElement(l.Text,{style:f.Text},"Foo \u9875\u9762")))};e.default=n},"src/views/Foo/index.tsx",["node_modules/@babel/runtime/helpers/interopRequireDefault.js","node_modules/react/index.js","node_modules/react-native/index.js"]);
--------------------------------------------------------------------------------
/Example/index.js:
--------------------------------------------------------------------------------
1 | // https://github.com/cssivision/react-native-qrcode/issues/32
2 | import './src'
3 |
--------------------------------------------------------------------------------
/Example/ios/Podfile:
--------------------------------------------------------------------------------
1 | require_relative '../node_modules/react-native/scripts/react_native_pods'
2 | require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
3 |
4 | platform :ios, '10.0'
5 |
6 | target 'rnCodeSplitDemo' do
7 | config = use_native_modules!
8 |
9 | use_react_native!(
10 | :path => config[:reactNativePath],
11 | # to enable hermes on iOS, change `false` to `true` and then install pods
12 | :hermes_enabled => false
13 | )
14 |
15 | target 'rnCodeSplitDemoTests' do
16 | inherit! :complete
17 | # Pods for testing
18 | end
19 |
20 | # Enables Flipper.
21 | #
22 | # Note that if you have use_frameworks! enabled, Flipper will not work and
23 | # you should disable the next line.
24 | use_flipper!()
25 |
26 | post_install do |installer|
27 | react_native_post_install(installer)
28 | end
29 | end
--------------------------------------------------------------------------------
/Example/ios/rnCodeSplitDemo.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 54;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 00E356F31AD99517003FC87E /* rnCodeSplitDemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* rnCodeSplitDemoTests.m */; };
11 | 0C3A1BCF0AC9C4DFA784B484 /* libPods-rnCodeSplitDemo-rnCodeSplitDemoTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DDDF2156038BAD673AFCBAEF /* libPods-rnCodeSplitDemo-rnCodeSplitDemoTests.a */; };
12 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };
13 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
14 | 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
15 | 373AA5F126817FD200A987E0 /* buz.ios.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 373AA5F026817FD200A987E0 /* buz.ios.bundle */; };
16 | 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; };
17 | C4E4075477773F64314F5ACB /* libPods-rnCodeSplitDemo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 8A28230AF50CAB8AE87C6957 /* libPods-rnCodeSplitDemo.a */; };
18 | /* End PBXBuildFile section */
19 |
20 | /* Begin PBXContainerItemProxy section */
21 | 00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = {
22 | isa = PBXContainerItemProxy;
23 | containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;
24 | proxyType = 1;
25 | remoteGlobalIDString = 13B07F861A680F5B00A75B9A;
26 | remoteInfo = rnCodeSplitDemo;
27 | };
28 | /* End PBXContainerItemProxy section */
29 |
30 | /* Begin PBXFileReference section */
31 | 00E356EE1AD99517003FC87E /* rnCodeSplitDemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = rnCodeSplitDemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
32 | 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
33 | 00E356F21AD99517003FC87E /* rnCodeSplitDemoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = rnCodeSplitDemoTests.m; sourceTree = ""; };
34 | 048686E5E3F1937D8A79C84D /* Pods-rnCodeSplitDemo-rnCodeSplitDemoTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-rnCodeSplitDemo-rnCodeSplitDemoTests.debug.xcconfig"; path = "Target Support Files/Pods-rnCodeSplitDemo-rnCodeSplitDemoTests/Pods-rnCodeSplitDemo-rnCodeSplitDemoTests.debug.xcconfig"; sourceTree = ""; };
35 | 13B07F961A680F5B00A75B9A /* rnCodeSplitDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = rnCodeSplitDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
36 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = rnCodeSplitDemo/AppDelegate.h; sourceTree = ""; };
37 | 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = rnCodeSplitDemo/AppDelegate.m; sourceTree = ""; };
38 | 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = rnCodeSplitDemo/Images.xcassets; sourceTree = ""; };
39 | 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = rnCodeSplitDemo/Info.plist; sourceTree = ""; };
40 | 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = rnCodeSplitDemo/main.m; sourceTree = ""; };
41 | 373AA5F026817FD200A987E0 /* buz.ios.bundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = buz.ios.bundle; path = ../dist/buz.ios.bundle; sourceTree = ""; };
42 | 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = rnCodeSplitDemo/LaunchScreen.storyboard; sourceTree = ""; };
43 | 8A28230AF50CAB8AE87C6957 /* libPods-rnCodeSplitDemo.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-rnCodeSplitDemo.a"; sourceTree = BUILT_PRODUCTS_DIR; };
44 | 8CD7B5450CAE831F0274CA31 /* Pods-rnCodeSplitDemo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-rnCodeSplitDemo.debug.xcconfig"; path = "Target Support Files/Pods-rnCodeSplitDemo/Pods-rnCodeSplitDemo.debug.xcconfig"; sourceTree = ""; };
45 | C52FD7EB343E547AC41EFF3C /* Pods-rnCodeSplitDemo-rnCodeSplitDemoTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-rnCodeSplitDemo-rnCodeSplitDemoTests.release.xcconfig"; path = "Target Support Files/Pods-rnCodeSplitDemo-rnCodeSplitDemoTests/Pods-rnCodeSplitDemo-rnCodeSplitDemoTests.release.xcconfig"; sourceTree = ""; };
46 | D1F3D3C00C7D7D4DE42B2D12 /* Pods-rnCodeSplitDemo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-rnCodeSplitDemo.release.xcconfig"; path = "Target Support Files/Pods-rnCodeSplitDemo/Pods-rnCodeSplitDemo.release.xcconfig"; sourceTree = ""; };
47 | DDDF2156038BAD673AFCBAEF /* libPods-rnCodeSplitDemo-rnCodeSplitDemoTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-rnCodeSplitDemo-rnCodeSplitDemoTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
48 | ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
49 | /* End PBXFileReference section */
50 |
51 | /* Begin PBXFrameworksBuildPhase section */
52 | 00E356EB1AD99517003FC87E /* Frameworks */ = {
53 | isa = PBXFrameworksBuildPhase;
54 | buildActionMask = 2147483647;
55 | files = (
56 | 0C3A1BCF0AC9C4DFA784B484 /* libPods-rnCodeSplitDemo-rnCodeSplitDemoTests.a in Frameworks */,
57 | );
58 | runOnlyForDeploymentPostprocessing = 0;
59 | };
60 | 13B07F8C1A680F5B00A75B9A /* Frameworks */ = {
61 | isa = PBXFrameworksBuildPhase;
62 | buildActionMask = 2147483647;
63 | files = (
64 | C4E4075477773F64314F5ACB /* libPods-rnCodeSplitDemo.a in Frameworks */,
65 | );
66 | runOnlyForDeploymentPostprocessing = 0;
67 | };
68 | /* End PBXFrameworksBuildPhase section */
69 |
70 | /* Begin PBXGroup section */
71 | 00E356EF1AD99517003FC87E /* rnCodeSplitDemoTests */ = {
72 | isa = PBXGroup;
73 | children = (
74 | 00E356F21AD99517003FC87E /* rnCodeSplitDemoTests.m */,
75 | 00E356F01AD99517003FC87E /* Supporting Files */,
76 | );
77 | path = rnCodeSplitDemoTests;
78 | sourceTree = "";
79 | };
80 | 00E356F01AD99517003FC87E /* Supporting Files */ = {
81 | isa = PBXGroup;
82 | children = (
83 | 00E356F11AD99517003FC87E /* Info.plist */,
84 | );
85 | name = "Supporting Files";
86 | sourceTree = "";
87 | };
88 | 13B07FAE1A68108700A75B9A /* rnCodeSplitDemo */ = {
89 | isa = PBXGroup;
90 | children = (
91 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */,
92 | 13B07FB01A68108700A75B9A /* AppDelegate.m */,
93 | 13B07FB51A68108700A75B9A /* Images.xcassets */,
94 | 13B07FB61A68108700A75B9A /* Info.plist */,
95 | 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */,
96 | 13B07FB71A68108700A75B9A /* main.m */,
97 | 373AA5F026817FD200A987E0 /* buz.ios.bundle */,
98 | );
99 | name = rnCodeSplitDemo;
100 | sourceTree = "";
101 | };
102 | 2D16E6871FA4F8E400B85C8A /* Frameworks */ = {
103 | isa = PBXGroup;
104 | children = (
105 | ED297162215061F000B7C4FE /* JavaScriptCore.framework */,
106 | 8A28230AF50CAB8AE87C6957 /* libPods-rnCodeSplitDemo.a */,
107 | DDDF2156038BAD673AFCBAEF /* libPods-rnCodeSplitDemo-rnCodeSplitDemoTests.a */,
108 | );
109 | name = Frameworks;
110 | sourceTree = "";
111 | };
112 | 832341AE1AAA6A7D00B99B32 /* Libraries */ = {
113 | isa = PBXGroup;
114 | children = (
115 | );
116 | name = Libraries;
117 | sourceTree = "";
118 | };
119 | 83CBB9F61A601CBA00E9B192 = {
120 | isa = PBXGroup;
121 | children = (
122 | 13B07FAE1A68108700A75B9A /* rnCodeSplitDemo */,
123 | 832341AE1AAA6A7D00B99B32 /* Libraries */,
124 | 00E356EF1AD99517003FC87E /* rnCodeSplitDemoTests */,
125 | 83CBBA001A601CBA00E9B192 /* Products */,
126 | 2D16E6871FA4F8E400B85C8A /* Frameworks */,
127 | D573A6DE2D75991A3F744499 /* Pods */,
128 | );
129 | indentWidth = 2;
130 | sourceTree = "";
131 | tabWidth = 2;
132 | usesTabs = 0;
133 | };
134 | 83CBBA001A601CBA00E9B192 /* Products */ = {
135 | isa = PBXGroup;
136 | children = (
137 | 13B07F961A680F5B00A75B9A /* rnCodeSplitDemo.app */,
138 | 00E356EE1AD99517003FC87E /* rnCodeSplitDemoTests.xctest */,
139 | );
140 | name = Products;
141 | sourceTree = "";
142 | };
143 | D573A6DE2D75991A3F744499 /* Pods */ = {
144 | isa = PBXGroup;
145 | children = (
146 | 8CD7B5450CAE831F0274CA31 /* Pods-rnCodeSplitDemo.debug.xcconfig */,
147 | D1F3D3C00C7D7D4DE42B2D12 /* Pods-rnCodeSplitDemo.release.xcconfig */,
148 | 048686E5E3F1937D8A79C84D /* Pods-rnCodeSplitDemo-rnCodeSplitDemoTests.debug.xcconfig */,
149 | C52FD7EB343E547AC41EFF3C /* Pods-rnCodeSplitDemo-rnCodeSplitDemoTests.release.xcconfig */,
150 | );
151 | path = Pods;
152 | sourceTree = "";
153 | };
154 | /* End PBXGroup section */
155 |
156 | /* Begin PBXNativeTarget section */
157 | 00E356ED1AD99517003FC87E /* rnCodeSplitDemoTests */ = {
158 | isa = PBXNativeTarget;
159 | buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "rnCodeSplitDemoTests" */;
160 | buildPhases = (
161 | DB4C4B98CF483D1F6B4AC63F /* [CP] Check Pods Manifest.lock */,
162 | 00E356EA1AD99517003FC87E /* Sources */,
163 | 00E356EB1AD99517003FC87E /* Frameworks */,
164 | 00E356EC1AD99517003FC87E /* Resources */,
165 | DC643CC6D8299D09329845B4 /* [CP] Embed Pods Frameworks */,
166 | F8E41E122E56A0BC0AEED00F /* [CP] Copy Pods Resources */,
167 | );
168 | buildRules = (
169 | );
170 | dependencies = (
171 | 00E356F51AD99517003FC87E /* PBXTargetDependency */,
172 | );
173 | name = rnCodeSplitDemoTests;
174 | productName = rnCodeSplitDemoTests;
175 | productReference = 00E356EE1AD99517003FC87E /* rnCodeSplitDemoTests.xctest */;
176 | productType = "com.apple.product-type.bundle.unit-test";
177 | };
178 | 13B07F861A680F5B00A75B9A /* rnCodeSplitDemo */ = {
179 | isa = PBXNativeTarget;
180 | buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "rnCodeSplitDemo" */;
181 | buildPhases = (
182 | B6483912DE8E69CD1DB94C8A /* [CP] Check Pods Manifest.lock */,
183 | FD10A7F022414F080027D42C /* Start Packager */,
184 | 13B07F871A680F5B00A75B9A /* Sources */,
185 | 13B07F8C1A680F5B00A75B9A /* Frameworks */,
186 | 13B07F8E1A680F5B00A75B9A /* Resources */,
187 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,
188 | 166F8D71509ACCA74E43227A /* [CP] Embed Pods Frameworks */,
189 | 875699373BEA6884891EAF75 /* [CP] Copy Pods Resources */,
190 | );
191 | buildRules = (
192 | );
193 | dependencies = (
194 | );
195 | name = rnCodeSplitDemo;
196 | productName = rnCodeSplitDemo;
197 | productReference = 13B07F961A680F5B00A75B9A /* rnCodeSplitDemo.app */;
198 | productType = "com.apple.product-type.application";
199 | };
200 | /* End PBXNativeTarget section */
201 |
202 | /* Begin PBXProject section */
203 | 83CBB9F71A601CBA00E9B192 /* Project object */ = {
204 | isa = PBXProject;
205 | attributes = {
206 | LastUpgradeCheck = 1210;
207 | TargetAttributes = {
208 | 00E356ED1AD99517003FC87E = {
209 | CreatedOnToolsVersion = 6.2;
210 | TestTargetID = 13B07F861A680F5B00A75B9A;
211 | };
212 | 13B07F861A680F5B00A75B9A = {
213 | LastSwiftMigration = 1120;
214 | };
215 | };
216 | };
217 | buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "rnCodeSplitDemo" */;
218 | compatibilityVersion = "Xcode 12.0";
219 | developmentRegion = en;
220 | hasScannedForEncodings = 0;
221 | knownRegions = (
222 | en,
223 | Base,
224 | );
225 | mainGroup = 83CBB9F61A601CBA00E9B192;
226 | productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */;
227 | projectDirPath = "";
228 | projectRoot = "";
229 | targets = (
230 | 13B07F861A680F5B00A75B9A /* rnCodeSplitDemo */,
231 | 00E356ED1AD99517003FC87E /* rnCodeSplitDemoTests */,
232 | );
233 | };
234 | /* End PBXProject section */
235 |
236 | /* Begin PBXResourcesBuildPhase section */
237 | 00E356EC1AD99517003FC87E /* Resources */ = {
238 | isa = PBXResourcesBuildPhase;
239 | buildActionMask = 2147483647;
240 | files = (
241 | );
242 | runOnlyForDeploymentPostprocessing = 0;
243 | };
244 | 13B07F8E1A680F5B00A75B9A /* Resources */ = {
245 | isa = PBXResourcesBuildPhase;
246 | buildActionMask = 2147483647;
247 | files = (
248 | 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */,
249 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
250 | 373AA5F126817FD200A987E0 /* buz.ios.bundle in Resources */,
251 | );
252 | runOnlyForDeploymentPostprocessing = 0;
253 | };
254 | /* End PBXResourcesBuildPhase section */
255 |
256 | /* Begin PBXShellScriptBuildPhase section */
257 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = {
258 | isa = PBXShellScriptBuildPhase;
259 | buildActionMask = 2147483647;
260 | files = (
261 | );
262 | inputPaths = (
263 | );
264 | name = "Bundle React Native code and images";
265 | outputPaths = (
266 | );
267 | runOnlyForDeploymentPostprocessing = 0;
268 | shellPath = /bin/sh;
269 | shellScript = "set -e\n\nexport NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh\n";
270 | };
271 | 166F8D71509ACCA74E43227A /* [CP] Embed Pods Frameworks */ = {
272 | isa = PBXShellScriptBuildPhase;
273 | buildActionMask = 2147483647;
274 | files = (
275 | );
276 | inputFileListPaths = (
277 | "${PODS_ROOT}/Target Support Files/Pods-rnCodeSplitDemo/Pods-rnCodeSplitDemo-frameworks-${CONFIGURATION}-input-files.xcfilelist",
278 | );
279 | name = "[CP] Embed Pods Frameworks";
280 | outputFileListPaths = (
281 | "${PODS_ROOT}/Target Support Files/Pods-rnCodeSplitDemo/Pods-rnCodeSplitDemo-frameworks-${CONFIGURATION}-output-files.xcfilelist",
282 | );
283 | runOnlyForDeploymentPostprocessing = 0;
284 | shellPath = /bin/sh;
285 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-rnCodeSplitDemo/Pods-rnCodeSplitDemo-frameworks.sh\"\n";
286 | showEnvVarsInLog = 0;
287 | };
288 | 875699373BEA6884891EAF75 /* [CP] Copy Pods Resources */ = {
289 | isa = PBXShellScriptBuildPhase;
290 | buildActionMask = 2147483647;
291 | files = (
292 | );
293 | inputFileListPaths = (
294 | "${PODS_ROOT}/Target Support Files/Pods-rnCodeSplitDemo/Pods-rnCodeSplitDemo-resources-${CONFIGURATION}-input-files.xcfilelist",
295 | );
296 | name = "[CP] Copy Pods Resources";
297 | outputFileListPaths = (
298 | "${PODS_ROOT}/Target Support Files/Pods-rnCodeSplitDemo/Pods-rnCodeSplitDemo-resources-${CONFIGURATION}-output-files.xcfilelist",
299 | );
300 | runOnlyForDeploymentPostprocessing = 0;
301 | shellPath = /bin/sh;
302 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-rnCodeSplitDemo/Pods-rnCodeSplitDemo-resources.sh\"\n";
303 | showEnvVarsInLog = 0;
304 | };
305 | B6483912DE8E69CD1DB94C8A /* [CP] Check Pods Manifest.lock */ = {
306 | isa = PBXShellScriptBuildPhase;
307 | buildActionMask = 2147483647;
308 | files = (
309 | );
310 | inputFileListPaths = (
311 | );
312 | inputPaths = (
313 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
314 | "${PODS_ROOT}/Manifest.lock",
315 | );
316 | name = "[CP] Check Pods Manifest.lock";
317 | outputFileListPaths = (
318 | );
319 | outputPaths = (
320 | "$(DERIVED_FILE_DIR)/Pods-rnCodeSplitDemo-checkManifestLockResult.txt",
321 | );
322 | runOnlyForDeploymentPostprocessing = 0;
323 | shellPath = /bin/sh;
324 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
325 | showEnvVarsInLog = 0;
326 | };
327 | DB4C4B98CF483D1F6B4AC63F /* [CP] Check Pods Manifest.lock */ = {
328 | isa = PBXShellScriptBuildPhase;
329 | buildActionMask = 2147483647;
330 | files = (
331 | );
332 | inputFileListPaths = (
333 | );
334 | inputPaths = (
335 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
336 | "${PODS_ROOT}/Manifest.lock",
337 | );
338 | name = "[CP] Check Pods Manifest.lock";
339 | outputFileListPaths = (
340 | );
341 | outputPaths = (
342 | "$(DERIVED_FILE_DIR)/Pods-rnCodeSplitDemo-rnCodeSplitDemoTests-checkManifestLockResult.txt",
343 | );
344 | runOnlyForDeploymentPostprocessing = 0;
345 | shellPath = /bin/sh;
346 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
347 | showEnvVarsInLog = 0;
348 | };
349 | DC643CC6D8299D09329845B4 /* [CP] Embed Pods Frameworks */ = {
350 | isa = PBXShellScriptBuildPhase;
351 | buildActionMask = 2147483647;
352 | files = (
353 | );
354 | inputFileListPaths = (
355 | "${PODS_ROOT}/Target Support Files/Pods-rnCodeSplitDemo-rnCodeSplitDemoTests/Pods-rnCodeSplitDemo-rnCodeSplitDemoTests-frameworks-${CONFIGURATION}-input-files.xcfilelist",
356 | );
357 | name = "[CP] Embed Pods Frameworks";
358 | outputFileListPaths = (
359 | "${PODS_ROOT}/Target Support Files/Pods-rnCodeSplitDemo-rnCodeSplitDemoTests/Pods-rnCodeSplitDemo-rnCodeSplitDemoTests-frameworks-${CONFIGURATION}-output-files.xcfilelist",
360 | );
361 | runOnlyForDeploymentPostprocessing = 0;
362 | shellPath = /bin/sh;
363 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-rnCodeSplitDemo-rnCodeSplitDemoTests/Pods-rnCodeSplitDemo-rnCodeSplitDemoTests-frameworks.sh\"\n";
364 | showEnvVarsInLog = 0;
365 | };
366 | F8E41E122E56A0BC0AEED00F /* [CP] Copy Pods Resources */ = {
367 | isa = PBXShellScriptBuildPhase;
368 | buildActionMask = 2147483647;
369 | files = (
370 | );
371 | inputFileListPaths = (
372 | "${PODS_ROOT}/Target Support Files/Pods-rnCodeSplitDemo-rnCodeSplitDemoTests/Pods-rnCodeSplitDemo-rnCodeSplitDemoTests-resources-${CONFIGURATION}-input-files.xcfilelist",
373 | );
374 | name = "[CP] Copy Pods Resources";
375 | outputFileListPaths = (
376 | "${PODS_ROOT}/Target Support Files/Pods-rnCodeSplitDemo-rnCodeSplitDemoTests/Pods-rnCodeSplitDemo-rnCodeSplitDemoTests-resources-${CONFIGURATION}-output-files.xcfilelist",
377 | );
378 | runOnlyForDeploymentPostprocessing = 0;
379 | shellPath = /bin/sh;
380 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-rnCodeSplitDemo-rnCodeSplitDemoTests/Pods-rnCodeSplitDemo-rnCodeSplitDemoTests-resources.sh\"\n";
381 | showEnvVarsInLog = 0;
382 | };
383 | FD10A7F022414F080027D42C /* Start Packager */ = {
384 | isa = PBXShellScriptBuildPhase;
385 | buildActionMask = 2147483647;
386 | files = (
387 | );
388 | inputFileListPaths = (
389 | );
390 | inputPaths = (
391 | );
392 | name = "Start Packager";
393 | outputFileListPaths = (
394 | );
395 | outputPaths = (
396 | );
397 | runOnlyForDeploymentPostprocessing = 0;
398 | shellPath = /bin/sh;
399 | shellScript = "export RCT_METRO_PORT=\"${RCT_METRO_PORT:=8081}\"\necho \"export RCT_METRO_PORT=${RCT_METRO_PORT}\" > \"${SRCROOT}/../node_modules/react-native/scripts/.packager.env\"\nif [ -z \"${RCT_NO_LAUNCH_PACKAGER+xxx}\" ] ; then\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\n if ! curl -s \"http://localhost:${RCT_METRO_PORT}/status\" | grep -q \"packager-status:running\" ; then\n echo \"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\"\n exit 2\n fi\n else\n open \"$SRCROOT/../node_modules/react-native/scripts/launchPackager.command\" || echo \"Can't start packager automatically\"\n fi\nfi\n";
400 | showEnvVarsInLog = 0;
401 | };
402 | /* End PBXShellScriptBuildPhase section */
403 |
404 | /* Begin PBXSourcesBuildPhase section */
405 | 00E356EA1AD99517003FC87E /* Sources */ = {
406 | isa = PBXSourcesBuildPhase;
407 | buildActionMask = 2147483647;
408 | files = (
409 | 00E356F31AD99517003FC87E /* rnCodeSplitDemoTests.m in Sources */,
410 | );
411 | runOnlyForDeploymentPostprocessing = 0;
412 | };
413 | 13B07F871A680F5B00A75B9A /* Sources */ = {
414 | isa = PBXSourcesBuildPhase;
415 | buildActionMask = 2147483647;
416 | files = (
417 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */,
418 | 13B07FC11A68108700A75B9A /* main.m in Sources */,
419 | );
420 | runOnlyForDeploymentPostprocessing = 0;
421 | };
422 | /* End PBXSourcesBuildPhase section */
423 |
424 | /* Begin PBXTargetDependency section */
425 | 00E356F51AD99517003FC87E /* PBXTargetDependency */ = {
426 | isa = PBXTargetDependency;
427 | target = 13B07F861A680F5B00A75B9A /* rnCodeSplitDemo */;
428 | targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */;
429 | };
430 | /* End PBXTargetDependency section */
431 |
432 | /* Begin XCBuildConfiguration section */
433 | 00E356F61AD99517003FC87E /* Debug */ = {
434 | isa = XCBuildConfiguration;
435 | baseConfigurationReference = 048686E5E3F1937D8A79C84D /* Pods-rnCodeSplitDemo-rnCodeSplitDemoTests.debug.xcconfig */;
436 | buildSettings = {
437 | BUNDLE_LOADER = "$(TEST_HOST)";
438 | GCC_PREPROCESSOR_DEFINITIONS = (
439 | "DEBUG=1",
440 | "$(inherited)",
441 | );
442 | INFOPLIST_FILE = rnCodeSplitDemoTests/Info.plist;
443 | IPHONEOS_DEPLOYMENT_TARGET = 10.0;
444 | LD_RUNPATH_SEARCH_PATHS = (
445 | "$(inherited)",
446 | "@executable_path/Frameworks",
447 | "@loader_path/Frameworks",
448 | );
449 | OTHER_LDFLAGS = (
450 | "-ObjC",
451 | "-lc++",
452 | "$(inherited)",
453 | );
454 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
455 | PRODUCT_NAME = "$(TARGET_NAME)";
456 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/rnCodeSplitDemo.app/rnCodeSplitDemo";
457 | };
458 | name = Debug;
459 | };
460 | 00E356F71AD99517003FC87E /* Release */ = {
461 | isa = XCBuildConfiguration;
462 | baseConfigurationReference = C52FD7EB343E547AC41EFF3C /* Pods-rnCodeSplitDemo-rnCodeSplitDemoTests.release.xcconfig */;
463 | buildSettings = {
464 | BUNDLE_LOADER = "$(TEST_HOST)";
465 | COPY_PHASE_STRIP = NO;
466 | INFOPLIST_FILE = rnCodeSplitDemoTests/Info.plist;
467 | IPHONEOS_DEPLOYMENT_TARGET = 10.0;
468 | LD_RUNPATH_SEARCH_PATHS = (
469 | "$(inherited)",
470 | "@executable_path/Frameworks",
471 | "@loader_path/Frameworks",
472 | );
473 | OTHER_LDFLAGS = (
474 | "-ObjC",
475 | "-lc++",
476 | "$(inherited)",
477 | );
478 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
479 | PRODUCT_NAME = "$(TARGET_NAME)";
480 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/rnCodeSplitDemo.app/rnCodeSplitDemo";
481 | };
482 | name = Release;
483 | };
484 | 13B07F941A680F5B00A75B9A /* Debug */ = {
485 | isa = XCBuildConfiguration;
486 | baseConfigurationReference = 8CD7B5450CAE831F0274CA31 /* Pods-rnCodeSplitDemo.debug.xcconfig */;
487 | buildSettings = {
488 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
489 | CLANG_ENABLE_MODULES = YES;
490 | CURRENT_PROJECT_VERSION = 1;
491 | ENABLE_BITCODE = NO;
492 | INFOPLIST_FILE = rnCodeSplitDemo/Info.plist;
493 | LD_RUNPATH_SEARCH_PATHS = (
494 | "$(inherited)",
495 | "@executable_path/Frameworks",
496 | );
497 | OTHER_LDFLAGS = (
498 | "$(inherited)",
499 | "-ObjC",
500 | "-lc++",
501 | );
502 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
503 | PRODUCT_NAME = rnCodeSplitDemo;
504 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
505 | SWIFT_VERSION = 5.0;
506 | VERSIONING_SYSTEM = "apple-generic";
507 | };
508 | name = Debug;
509 | };
510 | 13B07F951A680F5B00A75B9A /* Release */ = {
511 | isa = XCBuildConfiguration;
512 | baseConfigurationReference = D1F3D3C00C7D7D4DE42B2D12 /* Pods-rnCodeSplitDemo.release.xcconfig */;
513 | buildSettings = {
514 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
515 | CLANG_ENABLE_MODULES = YES;
516 | CURRENT_PROJECT_VERSION = 1;
517 | INFOPLIST_FILE = rnCodeSplitDemo/Info.plist;
518 | LD_RUNPATH_SEARCH_PATHS = (
519 | "$(inherited)",
520 | "@executable_path/Frameworks",
521 | );
522 | OTHER_LDFLAGS = (
523 | "$(inherited)",
524 | "-ObjC",
525 | "-lc++",
526 | );
527 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
528 | PRODUCT_NAME = rnCodeSplitDemo;
529 | SWIFT_VERSION = 5.0;
530 | VERSIONING_SYSTEM = "apple-generic";
531 | };
532 | name = Release;
533 | };
534 | 83CBBA201A601CBA00E9B192 /* Debug */ = {
535 | isa = XCBuildConfiguration;
536 | buildSettings = {
537 | ALWAYS_SEARCH_USER_PATHS = NO;
538 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
539 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
540 | CLANG_CXX_LIBRARY = "libc++";
541 | CLANG_ENABLE_MODULES = YES;
542 | CLANG_ENABLE_OBJC_ARC = YES;
543 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
544 | CLANG_WARN_BOOL_CONVERSION = YES;
545 | CLANG_WARN_COMMA = YES;
546 | CLANG_WARN_CONSTANT_CONVERSION = YES;
547 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
548 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
549 | CLANG_WARN_EMPTY_BODY = YES;
550 | CLANG_WARN_ENUM_CONVERSION = YES;
551 | CLANG_WARN_INFINITE_RECURSION = YES;
552 | CLANG_WARN_INT_CONVERSION = YES;
553 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
554 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
555 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
556 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
557 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
558 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
559 | CLANG_WARN_STRICT_PROTOTYPES = YES;
560 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
561 | CLANG_WARN_UNREACHABLE_CODE = YES;
562 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
563 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
564 | COPY_PHASE_STRIP = NO;
565 | ENABLE_STRICT_OBJC_MSGSEND = YES;
566 | ENABLE_TESTABILITY = YES;
567 | "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "arm64 ";
568 | GCC_C_LANGUAGE_STANDARD = gnu99;
569 | GCC_DYNAMIC_NO_PIC = NO;
570 | GCC_NO_COMMON_BLOCKS = YES;
571 | GCC_OPTIMIZATION_LEVEL = 0;
572 | GCC_PREPROCESSOR_DEFINITIONS = (
573 | "DEBUG=1",
574 | "$(inherited)",
575 | );
576 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
577 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
578 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
579 | GCC_WARN_UNDECLARED_SELECTOR = YES;
580 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
581 | GCC_WARN_UNUSED_FUNCTION = YES;
582 | GCC_WARN_UNUSED_VARIABLE = YES;
583 | IPHONEOS_DEPLOYMENT_TARGET = 10.0;
584 | LD_RUNPATH_SEARCH_PATHS = (
585 | /usr/lib/swift,
586 | "$(inherited)",
587 | );
588 | LIBRARY_SEARCH_PATHS = (
589 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"",
590 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"",
591 | "\"$(inherited)\"",
592 | );
593 | MTL_ENABLE_DEBUG_INFO = YES;
594 | ONLY_ACTIVE_ARCH = YES;
595 | SDKROOT = iphoneos;
596 | };
597 | name = Debug;
598 | };
599 | 83CBBA211A601CBA00E9B192 /* Release */ = {
600 | isa = XCBuildConfiguration;
601 | buildSettings = {
602 | ALWAYS_SEARCH_USER_PATHS = NO;
603 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
604 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
605 | CLANG_CXX_LIBRARY = "libc++";
606 | CLANG_ENABLE_MODULES = YES;
607 | CLANG_ENABLE_OBJC_ARC = YES;
608 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
609 | CLANG_WARN_BOOL_CONVERSION = YES;
610 | CLANG_WARN_COMMA = YES;
611 | CLANG_WARN_CONSTANT_CONVERSION = YES;
612 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
613 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
614 | CLANG_WARN_EMPTY_BODY = YES;
615 | CLANG_WARN_ENUM_CONVERSION = YES;
616 | CLANG_WARN_INFINITE_RECURSION = YES;
617 | CLANG_WARN_INT_CONVERSION = YES;
618 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
619 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
620 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
621 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
622 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
623 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
624 | CLANG_WARN_STRICT_PROTOTYPES = YES;
625 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
626 | CLANG_WARN_UNREACHABLE_CODE = YES;
627 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
628 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
629 | COPY_PHASE_STRIP = YES;
630 | ENABLE_NS_ASSERTIONS = NO;
631 | ENABLE_STRICT_OBJC_MSGSEND = YES;
632 | "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "arm64 ";
633 | GCC_C_LANGUAGE_STANDARD = gnu99;
634 | GCC_NO_COMMON_BLOCKS = YES;
635 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
636 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
637 | GCC_WARN_UNDECLARED_SELECTOR = YES;
638 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
639 | GCC_WARN_UNUSED_FUNCTION = YES;
640 | GCC_WARN_UNUSED_VARIABLE = YES;
641 | IPHONEOS_DEPLOYMENT_TARGET = 10.0;
642 | LD_RUNPATH_SEARCH_PATHS = (
643 | /usr/lib/swift,
644 | "$(inherited)",
645 | );
646 | LIBRARY_SEARCH_PATHS = (
647 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"",
648 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"",
649 | "\"$(inherited)\"",
650 | );
651 | MTL_ENABLE_DEBUG_INFO = NO;
652 | SDKROOT = iphoneos;
653 | VALIDATE_PRODUCT = YES;
654 | };
655 | name = Release;
656 | };
657 | /* End XCBuildConfiguration section */
658 |
659 | /* Begin XCConfigurationList section */
660 | 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "rnCodeSplitDemoTests" */ = {
661 | isa = XCConfigurationList;
662 | buildConfigurations = (
663 | 00E356F61AD99517003FC87E /* Debug */,
664 | 00E356F71AD99517003FC87E /* Release */,
665 | );
666 | defaultConfigurationIsVisible = 0;
667 | defaultConfigurationName = Release;
668 | };
669 | 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "rnCodeSplitDemo" */ = {
670 | isa = XCConfigurationList;
671 | buildConfigurations = (
672 | 13B07F941A680F5B00A75B9A /* Debug */,
673 | 13B07F951A680F5B00A75B9A /* Release */,
674 | );
675 | defaultConfigurationIsVisible = 0;
676 | defaultConfigurationName = Release;
677 | };
678 | 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "rnCodeSplitDemo" */ = {
679 | isa = XCConfigurationList;
680 | buildConfigurations = (
681 | 83CBBA201A601CBA00E9B192 /* Debug */,
682 | 83CBBA211A601CBA00E9B192 /* Release */,
683 | );
684 | defaultConfigurationIsVisible = 0;
685 | defaultConfigurationName = Release;
686 | };
687 | /* End XCConfigurationList section */
688 | };
689 | rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */;
690 | }
691 |
--------------------------------------------------------------------------------
/Example/ios/rnCodeSplitDemo.xcodeproj/xcshareddata/xcschemes/rnCodeSplitDemo.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
33 |
39 |
40 |
41 |
42 |
43 |
53 |
55 |
61 |
62 |
63 |
64 |
70 |
72 |
78 |
79 |
80 |
81 |
83 |
84 |
87 |
88 |
89 |
--------------------------------------------------------------------------------
/Example/ios/rnCodeSplitDemo.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Example/ios/rnCodeSplitDemo.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Example/ios/rnCodeSplitDemo/AppDelegate.h:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 |
4 | @interface AppDelegate : UIResponder
5 |
6 | @property (nonatomic, strong) UIWindow *window;
7 |
8 | @end
9 |
--------------------------------------------------------------------------------
/Example/ios/rnCodeSplitDemo/AppDelegate.m:
--------------------------------------------------------------------------------
1 | #import "AppDelegate.h"
2 |
3 | #import
4 | #import
5 | #import
6 |
7 | #ifdef FB_SONARKIT_ENABLED
8 | #import
9 | #import
10 | #import
11 | #import
12 | #import
13 | #import
14 |
15 | static void InitializeFlipper(UIApplication *application) {
16 | FlipperClient *client = [FlipperClient sharedClient];
17 | SKDescriptorMapper *layoutDescriptorMapper = [[SKDescriptorMapper alloc] initWithDefaults];
18 | [client addPlugin:[[FlipperKitLayoutPlugin alloc] initWithRootNode:application withDescriptorMapper:layoutDescriptorMapper]];
19 | [client addPlugin:[[FKUserDefaultsPlugin alloc] initWithSuiteName:nil]];
20 | [client addPlugin:[FlipperKitReactPlugin new]];
21 | [client addPlugin:[[FlipperKitNetworkPlugin alloc] initWithNetworkAdapter:[SKIOSNetworkAdapter new]]];
22 | [client start];
23 | }
24 | #endif
25 |
26 | @implementation AppDelegate
27 |
28 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
29 | {
30 | #ifdef FB_SONARKIT_ENABLED
31 | InitializeFlipper(application);
32 | #endif
33 |
34 | RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
35 | RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
36 | moduleName:@"rnCodeSplitDemo"
37 | initialProperties:nil];
38 |
39 | if (@available(iOS 13.0, *)) {
40 | rootView.backgroundColor = [UIColor systemBackgroundColor];
41 | } else {
42 | rootView.backgroundColor = [UIColor whiteColor];
43 | }
44 |
45 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
46 | UIViewController *rootViewController = [UIViewController new];
47 | rootViewController.view = rootView;
48 | self.window.rootViewController = rootViewController;
49 | [self.window makeKeyAndVisible];
50 | return YES;
51 | }
52 |
53 | - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
54 | {
55 | //#if DEBUG
56 | // return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
57 | //#else
58 | return [[NSBundle mainBundle] URLForResource:@"buz.ios" withExtension:@"bundle"];
59 | //#endif
60 | }
61 |
62 | @end
63 |
--------------------------------------------------------------------------------
/Example/ios/rnCodeSplitDemo/Images.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "29x29",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "29x29",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "40x40",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "40x40",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "60x60",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "60x60",
31 | "scale" : "3x"
32 | }
33 | ],
34 | "info" : {
35 | "version" : 1,
36 | "author" : "xcode"
37 | }
38 | }
--------------------------------------------------------------------------------
/Example/ios/rnCodeSplitDemo/Images.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/Example/ios/rnCodeSplitDemo/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | rnCodeSplitDemo
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | 1
25 | LSRequiresIPhoneOS
26 |
27 | NSAppTransportSecurity
28 |
29 | NSExceptionDomains
30 |
31 | localhost
32 |
33 | NSExceptionAllowsInsecureHTTPLoads
34 |
35 |
36 |
37 |
38 | NSLocationWhenInUseUsageDescription
39 |
40 | UILaunchStoryboardName
41 | LaunchScreen
42 | UIRequiredDeviceCapabilities
43 |
44 | armv7
45 |
46 | UISupportedInterfaceOrientations
47 |
48 | UIInterfaceOrientationPortrait
49 | UIInterfaceOrientationLandscapeLeft
50 | UIInterfaceOrientationLandscapeRight
51 |
52 | UIViewControllerBasedStatusBarAppearance
53 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/Example/ios/rnCodeSplitDemo/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/Example/ios/rnCodeSplitDemo/main.m:
--------------------------------------------------------------------------------
1 | #import
2 |
3 | #import "AppDelegate.h"
4 |
5 | int main(int argc, char * argv[]) {
6 | @autoreleasepool {
7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/Example/ios/rnCodeSplitDemoTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 |
24 |
25 |
--------------------------------------------------------------------------------
/Example/ios/rnCodeSplitDemoTests/rnCodeSplitDemoTests.m:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 |
4 | #import
5 | #import
6 |
7 | #define TIMEOUT_SECONDS 600
8 | #define TEXT_TO_LOOK_FOR @"Welcome to React"
9 |
10 | @interface rnCodeSplitDemoTests : XCTestCase
11 |
12 | @end
13 |
14 | @implementation rnCodeSplitDemoTests
15 |
16 | - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test
17 | {
18 | if (test(view)) {
19 | return YES;
20 | }
21 | for (UIView *subview in [view subviews]) {
22 | if ([self findSubviewInView:subview matching:test]) {
23 | return YES;
24 | }
25 | }
26 | return NO;
27 | }
28 |
29 | - (void)testRendersWelcomeScreen
30 | {
31 | UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController];
32 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS];
33 | BOOL foundElement = NO;
34 |
35 | __block NSString *redboxError = nil;
36 | #ifdef DEBUG
37 | RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) {
38 | if (level >= RCTLogLevelError) {
39 | redboxError = message;
40 | }
41 | });
42 | #endif
43 |
44 | while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) {
45 | [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
46 | [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
47 |
48 | foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) {
49 | if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) {
50 | return YES;
51 | }
52 | return NO;
53 | }];
54 | }
55 |
56 | #ifdef DEBUG
57 | RCTSetLogFunction(RCTDefaultLogFunction);
58 | #endif
59 |
60 | XCTAssertNil(redboxError, @"RedBox error: %@", redboxError);
61 | XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS);
62 | }
63 |
64 |
65 | @end
66 |
--------------------------------------------------------------------------------
/Example/metro.config.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Metro configuration for React Native
3 | * https://github.com/facebook/react-native
4 | *
5 | * @format
6 | */
7 |
8 | const Mcs = require('metro-code-split')
9 |
10 | const mcs = new Mcs({
11 | output: {
12 | // Only test
13 | publicPath: 'https://github.githubassets.com/a-rn-project',
14 | },
15 | dll: {
16 | entry: ['react-native', 'react'],
17 | referenceDir: './public/dll',
18 | },
19 | dynamicImports: { minSize: 0 },
20 | })
21 |
22 | const busineConfig = {
23 | transformer: {
24 | getTransformOptions: async () => ({
25 | transform: {
26 | experimentalImportSupport: false,
27 | inlineRequires: true,
28 | },
29 | }),
30 | },
31 | }
32 |
33 | module.exports =
34 | process.env.NODE_ENV === 'production'
35 | ? mcs.mergeTo(busineConfig)
36 | : busineConfig
37 |
--------------------------------------------------------------------------------
/Example/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "rn-code-split-demo",
3 | "version": "0.1.3",
4 | "private": true,
5 | "scripts": {
6 | "android": "react-native run-android",
7 | "ios": "react-native run-ios",
8 | "start": "mcs-scripts start -p 8081",
9 | "build:dllJson": "mcs-scripts build -t dllJson -od public/dll",
10 | "build:dll": "mcs-scripts build -t dll -od public/dll",
11 | "build": "mcs-scripts build -t busine -e index.js",
12 | "test": "jest",
13 | "lint": "eslint . --ext .js,.jsx,.ts,.tsx"
14 | },
15 | "dependencies": {
16 | "@react-native-community/masked-view": "^0.1.11",
17 | "@react-navigation/native": "^5.9.4",
18 | "@react-navigation/stack": "^5.14.5",
19 | "react": "17.0.1",
20 | "react-native": "0.64.1",
21 | "react-native-gesture-handler": "^1.10.3",
22 | "react-native-reanimated": "^2.2.0",
23 | "react-native-safe-area-context": "^3.2.0",
24 | "react-native-screens": "^3.4.0"
25 | },
26 | "devDependencies": {
27 | "@babel/core": "^7.12.9",
28 | "@babel/plugin-proposal-decorators": "^7.14.5",
29 | "@babel/runtime": "^7.12.5",
30 | "@react-native-community/eslint-config": "^2.0.0",
31 | "@types/jest": "^26.0.23",
32 | "@types/react-native": "^0.64.5",
33 | "@types/react-test-renderer": "^16.9.2",
34 | "babel-jest": "^26.6.3",
35 | "eslint": "^7.14.0",
36 | "jest": "^26.6.3",
37 | "metro-code-split": "^0.1.7",
38 | "metro-react-native-babel-preset": "^0.64.0",
39 | "react-test-renderer": "17.0.1",
40 | "typescript": "^3.8.3"
41 | },
42 | "resolutions": {
43 | "@types/react": "^17"
44 | },
45 | "jest": {
46 | "preset": "react-native",
47 | "moduleFileExtensions": [
48 | "ts",
49 | "tsx",
50 | "js",
51 | "jsx",
52 | "json",
53 | "node"
54 | ]
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/Example/public/dll/_dll.android.json:
--------------------------------------------------------------------------------
1 | [
2 | "__prelude__",
3 | "node_modules/metro-runtime/src/polyfills/require.js",
4 | "node_modules/@react-native/polyfills/console.js",
5 | "node_modules/@react-native/polyfills/error-guard.js",
6 | "node_modules/@react-native/polyfills/Object.es7.js",
7 | "require-node_modules/react-native/Libraries/Core/InitializeCore.js",
8 | "node_modules/react-native/index.js",
9 | "node_modules/react-native/Libraries/Components/AccessibilityInfo/AccessibilityInfo.android.js",
10 | "node_modules/@babel/runtime/helpers/interopRequireDefault.js",
11 | "node_modules/react-native/Libraries/EventEmitter/RCTDeviceEventEmitter.js",
12 | "node_modules/@babel/runtime/helpers/classCallCheck.js",
13 | "node_modules/@babel/runtime/helpers/createClass.js",
14 | "node_modules/@babel/runtime/helpers/get.js",
15 | "node_modules/@babel/runtime/helpers/superPropBase.js",
16 | "node_modules/@babel/runtime/helpers/getPrototypeOf.js",
17 | "node_modules/@babel/runtime/helpers/inherits.js",
18 | "node_modules/@babel/runtime/helpers/setPrototypeOf.js",
19 | "node_modules/@babel/runtime/helpers/possibleConstructorReturn.js",
20 | "node_modules/@babel/runtime/helpers/typeof.js",
21 | "node_modules/@babel/runtime/helpers/assertThisInitialized.js",
22 | "node_modules/react-native/Libraries/vendor/emitter/EventEmitter.js",
23 | "node_modules/react-native/Libraries/vendor/emitter/_EventEmitter.js",
24 | "node_modules/react-native/Libraries/vendor/emitter/_EmitterSubscription.js",
25 | "node_modules/react-native/Libraries/vendor/emitter/_EventSubscription.js",
26 | "node_modules/react-native/Libraries/vendor/emitter/_EventSubscriptionVendor.js",
27 | "node_modules/invariant/browser.js",
28 | "node_modules/react-native/Libraries/ReactNative/UIManager.js",
29 | "node_modules/react-native/Libraries/ReactNative/DummyUIManager.js",
30 | "node_modules/react-native/Libraries/ReactNative/PaperUIManager.js",
31 | "node_modules/@babel/runtime/helpers/extends.js",
32 | "node_modules/react-native/Libraries/ReactNative/NativeUIManager.js",
33 | "node_modules/react-native/Libraries/TurboModule/TurboModuleRegistry.js",
34 | "node_modules/react-native/Libraries/BatchedBridge/NativeModules.js",
35 | "node_modules/@babel/runtime/helpers/slicedToArray.js",
36 | "node_modules/@babel/runtime/helpers/arrayWithHoles.js",
37 | "node_modules/@babel/runtime/helpers/iterableToArrayLimit.js",
38 | "node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js",
39 | "node_modules/@babel/runtime/helpers/arrayLikeToArray.js",
40 | "node_modules/@babel/runtime/helpers/nonIterableRest.js",
41 | "node_modules/react-native/Libraries/BatchedBridge/BatchedBridge.js",
42 | "node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js",
43 | "node_modules/react-native/Libraries/Performance/Systrace.js",
44 | "node_modules/react-native/Libraries/vendor/core/ErrorUtils.js",
45 | "node_modules/react-native/Libraries/Utilities/stringifySafe.js",
46 | "node_modules/@babel/runtime/helpers/toConsumableArray.js",
47 | "node_modules/@babel/runtime/helpers/arrayWithoutHoles.js",
48 | "node_modules/@babel/runtime/helpers/iterableToArray.js",
49 | "node_modules/@babel/runtime/helpers/nonIterableSpread.js",
50 | "node_modules/react-native/Libraries/Utilities/defineLazyObjectProperty.js",
51 | "node_modules/react-native/Libraries/ReactNative/UIManagerProperties.js",
52 | "node_modules/react-native/Libraries/Components/AccessibilityInfo/NativeAccessibilityInfo.js",
53 | "node_modules/react-native/Libraries/Components/ActivityIndicator/ActivityIndicator.js",
54 | "node_modules/react/index.js",
55 | "node_modules/react/cjs/react.production.min.js",
56 | "node_modules/object-assign/index.js",
57 | "node_modules/react-native/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js",
58 | "node_modules/react-native/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidNativeComponent.js",
59 | "node_modules/react-native/Libraries/Utilities/codegenNativeComponent.js",
60 | "node_modules/react-native/Libraries/ReactNative/requireNativeComponent.js",
61 | "node_modules/react-native/Libraries/Renderer/shims/createReactNativeComponentClass.js",
62 | "node_modules/react-native/Libraries/ReactPrivate/ReactNativePrivateInterface.js",
63 | "node_modules/react-native/Libraries/Core/ExceptionsManager.js",
64 | "node_modules/@babel/runtime/helpers/wrapNativeSuper.js",
65 | "node_modules/@babel/runtime/helpers/isNativeFunction.js",
66 | "node_modules/@babel/runtime/helpers/construct.js",
67 | "node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js",
68 | "node_modules/react-native/Libraries/Core/NativeExceptionsManager.js",
69 | "node_modules/react-native/Libraries/Core/Devtools/parseErrorStack.js",
70 | "node_modules/stacktrace-parser/dist/stack-trace-parser.cjs.js",
71 | "node_modules/react-native/Libraries/Core/Devtools/parseHermesStack.js",
72 | "node_modules/react-native/Libraries/Utilities/Platform.android.js",
73 | "node_modules/react-native/Libraries/Utilities/NativePlatformConstantsAndroid.js",
74 | "node_modules/react-native/Libraries/EventEmitter/RCTEventEmitter.js",
75 | "node_modules/react-native/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js",
76 | "node_modules/react-native/Libraries/Components/TextInput/TextInputState.js",
77 | "node_modules/react-native/Libraries/Renderer/shims/ReactNative.js",
78 | "node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js",
79 | "node_modules/react-native/Libraries/ReactPrivate/ReactNativePrivateInitializeCore.js",
80 | "node_modules/react-native/Libraries/Core/InitializeCore.js",
81 | "node_modules/react-native/Libraries/Core/setUpGlobals.js",
82 | "node_modules/react-native/Libraries/Core/setUpPerformance.js",
83 | "node_modules/react-native/Libraries/Core/setUpSystrace.js",
84 | "node_modules/react-native/Libraries/Core/setUpErrorHandling.js",
85 | "node_modules/react-native/Libraries/Core/polyfillPromise.js",
86 | "node_modules/react-native/Libraries/Utilities/PolyfillFunctions.js",
87 | "node_modules/react-native/Libraries/Promise.js",
88 | "node_modules/promise/setimmediate/done.js",
89 | "node_modules/promise/setimmediate/core.js",
90 | "node_modules/promise/setimmediate/finally.js",
91 | "node_modules/promise/setimmediate/es6-extensions.js",
92 | "node_modules/react-native/Libraries/Core/setUpRegeneratorRuntime.js",
93 | "node_modules/regenerator-runtime/runtime.js",
94 | "node_modules/react-native/Libraries/Core/setUpTimers.js",
95 | "node_modules/react-native/Libraries/Core/Timers/JSTimers.js",
96 | "node_modules/react-native/Libraries/Core/Timers/NativeTiming.js",
97 | "node_modules/react-native/Libraries/Core/setUpXHR.js",
98 | "node_modules/react-native/Libraries/Network/XMLHttpRequest.js",
99 | "node_modules/react-native/Libraries/Blob/BlobManager.js",
100 | "node_modules/react-native/Libraries/Blob/NativeBlobModule.js",
101 | "node_modules/react-native/Libraries/Blob/Blob.js",
102 | "node_modules/react-native/Libraries/Blob/BlobRegistry.js",
103 | "node_modules/event-target-shim/dist/event-target-shim.js",
104 | "node_modules/react-native/Libraries/Utilities/GlobalPerformanceLogger.js",
105 | "node_modules/react-native/Libraries/Utilities/createPerformanceLogger.js",
106 | "node_modules/base64-js/index.js",
107 | "node_modules/react-native/Libraries/Network/RCTNetworking.android.js",
108 | "node_modules/react-native/Libraries/EventEmitter/NativeEventEmitter.js",
109 | "node_modules/react-native/Libraries/Network/NativeNetworkingAndroid.js",
110 | "node_modules/react-native/Libraries/Network/convertRequestBody.js",
111 | "node_modules/react-native/Libraries/Network/FormData.js",
112 | "node_modules/react-native/Libraries/Utilities/binaryToBase64.js",
113 | "node_modules/react-native/Libraries/Network/fetch.js",
114 | "node_modules/whatwg-fetch/dist/fetch.umd.js",
115 | "node_modules/react-native/Libraries/WebSocket/WebSocket.js",
116 | "node_modules/@babel/runtime/helpers/objectWithoutProperties.js",
117 | "node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js",
118 | "node_modules/react-native/Libraries/WebSocket/NativeWebSocketModule.js",
119 | "node_modules/react-native/Libraries/WebSocket/WebSocketEvent.js",
120 | "node_modules/react-native/Libraries/Blob/File.js",
121 | "node_modules/react-native/Libraries/Blob/FileReader.js",
122 | "node_modules/react-native/Libraries/Blob/NativeFileReaderModule.js",
123 | "node_modules/react-native/Libraries/Blob/URL.js",
124 | "node_modules/abort-controller/dist/abort-controller.js",
125 | "node_modules/react-native/Libraries/Core/setUpAlert.js",
126 | "node_modules/react-native/Libraries/Alert/Alert.js",
127 | "node_modules/react-native/Libraries/NativeModules/specs/NativeDialogManagerAndroid.js",
128 | "node_modules/react-native/Libraries/Alert/RCTAlertManager.android.js",
129 | "node_modules/react-native/Libraries/Core/setUpNavigator.js",
130 | "node_modules/react-native/Libraries/Core/setUpBatchedBridge.js",
131 | "node_modules/react-native/Libraries/HeapCapture/HeapCapture.js",
132 | "node_modules/react-native/Libraries/HeapCapture/NativeJSCHeapCapture.js",
133 | "node_modules/react-native/Libraries/Performance/SamplingProfiler.js",
134 | "node_modules/react-native/Libraries/Performance/NativeJSCSamplingProfiler.js",
135 | "node_modules/react-native/Libraries/Utilities/RCTLog.js",
136 | "node_modules/react-native/Libraries/EventEmitter/RCTNativeAppEventEmitter.js",
137 | "node_modules/react-native/Libraries/Utilities/JSDevSupportModule.js",
138 | "node_modules/react-native/Libraries/Utilities/NativeJSDevSupport.js",
139 | "node_modules/react-native/Libraries/Utilities/HMRClientProdShim.js",
140 | "node_modules/react-native/Libraries/Core/setUpSegmentFetcher.js",
141 | "node_modules/react-native/Libraries/Core/SegmentFetcher/NativeSegmentFetcher.js",
142 | "node_modules/scheduler/index.js",
143 | "node_modules/scheduler/cjs/scheduler.production.min.js",
144 | "node_modules/react-native/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js",
145 | "node_modules/react-native/Libraries/Utilities/codegenNativeCommands.js",
146 | "node_modules/react-native/Libraries/Components/TextInput/AndroidTextInputViewConfig.js",
147 | "node_modules/react-native/Libraries/Components/View/ReactNativeViewViewConfig.js",
148 | "node_modules/react-native/Libraries/Components/View/ReactNativeViewViewConfigAndroid.js",
149 | "node_modules/react-native/Libraries/StyleSheet/processColor.js",
150 | "node_modules/react-native/Libraries/StyleSheet/normalizeColor.js",
151 | "node_modules/@react-native/normalize-color/base.js",
152 | "node_modules/react-native/Libraries/StyleSheet/PlatformColorValueTypes.android.js",
153 | "node_modules/react-native/Libraries/Utilities/differ/insetsDiffer.js",
154 | "node_modules/react-native/Libraries/Utilities/differ/sizesDiffer.js",
155 | "node_modules/react-native/Libraries/Utilities/differ/matricesDiffer.js",
156 | "node_modules/react-native/Libraries/StyleSheet/processTransform.js",
157 | "node_modules/react-native/Libraries/Utilities/MatrixMath.js",
158 | "node_modules/react-native/Libraries/Utilities/differ/deepDiffer.js",
159 | "node_modules/react-native/Libraries/Utilities/deepFreezeAndThrowOnMutationInDev.js",
160 | "node_modules/react-native/Libraries/StyleSheet/flattenStyle.js",
161 | "node_modules/react-native/Libraries/Core/ReactFiberErrorDialog.js",
162 | "node_modules/react-native/Libraries/ReactNative/getNativeComponentAttributes.js",
163 | "node_modules/react-native/Libraries/Components/View/ReactNativeStyleAttributes.js",
164 | "node_modules/react-native/Libraries/DeprecatedPropTypes/DeprecatedViewStylePropTypes.js",
165 | "node_modules/react-native/Libraries/DeprecatedPropTypes/DeprecatedLayoutPropTypes.js",
166 | "node_modules/prop-types/index.js",
167 | "node_modules/prop-types/factoryWithThrowingShims.js",
168 | "node_modules/prop-types/lib/ReactPropTypesSecret.js",
169 | "node_modules/react-native/Libraries/DeprecatedPropTypes/DeprecatedShadowPropTypesIOS.js",
170 | "node_modules/react-native/Libraries/DeprecatedPropTypes/DeprecatedColorPropType.js",
171 | "node_modules/react-native/Libraries/DeprecatedPropTypes/DeprecatedTransformPropTypes.js",
172 | "node_modules/react-native/Libraries/Utilities/deprecatedPropType.js",
173 | "node_modules/react-native/Libraries/DeprecatedPropTypes/DeprecatedTextStylePropTypes.js",
174 | "node_modules/react-native/Libraries/DeprecatedPropTypes/DeprecatedImageStylePropTypes.js",
175 | "node_modules/react-native/Libraries/Utilities/differ/pointsDiffer.js",
176 | "node_modules/react-native/Libraries/StyleSheet/processColorArray.js",
177 | "node_modules/react-native/Libraries/Image/resolveAssetSource.js",
178 | "node_modules/react-native/Libraries/NativeModules/specs/NativeSourceCode.js",
179 | "node_modules/@react-native/assets/registry.js",
180 | "node_modules/react-native/Libraries/Image/AssetSourceResolver.js",
181 | "node_modules/react-native/Libraries/Utilities/PixelRatio.js",
182 | "node_modules/react-native/Libraries/Utilities/Dimensions.js",
183 | "node_modules/react-native/Libraries/Utilities/NativeDeviceInfo.js",
184 | "node_modules/@react-native/assets/path-support.js",
185 | "node_modules/react-native/Libraries/Components/View/View.js",
186 | "node_modules/react-native/Libraries/Components/View/ViewNativeComponent.js",
187 | "node_modules/react-native/Libraries/Utilities/registerGeneratedViewConfig.js",
188 | "node_modules/react-native/Libraries/Utilities/verifyComponentAttributeEquivalence.js",
189 | "node_modules/react-native/Libraries/Text/TextAncestor.js",
190 | "node_modules/react-native/Libraries/StyleSheet/StyleSheet.js",
191 | "node_modules/react-native/Libraries/Components/Button.js",
192 | "node_modules/react-native/Libraries/Components/Touchable/TouchableNativeFeedback.js",
193 | "node_modules/react-native/Libraries/Pressability/Pressability.js",
194 | "node_modules/react-native/Libraries/Components/Sound/SoundManager.js",
195 | "node_modules/react-native/Libraries/Components/Sound/NativeSoundManager.js",
196 | "node_modules/react-native/Libraries/Pressability/HoverState.js",
197 | "node_modules/react-native/Libraries/StyleSheet/Rect.js",
198 | "node_modules/react-native/Libraries/Text/Text.js",
199 | "node_modules/react-native/Libraries/Text/TextInjection.js",
200 | "node_modules/react-native/Libraries/Components/Touchable/Touchable.js",
201 | "node_modules/react-native/Libraries/Components/Touchable/Position.js",
202 | "node_modules/react-native/Libraries/Components/Touchable/PooledClass.js",
203 | "node_modules/react-native/Libraries/Components/Touchable/BoundingDimensions.js",
204 | "node_modules/react-native/Libraries/Text/TextNativeComponent.js",
205 | "node_modules/react-native/Libraries/Components/View/ReactNativeViewAttributes.js",
206 | "node_modules/nullthrows/nullthrows.js",
207 | "node_modules/react-native/Libraries/DeprecatedPropTypes/DeprecatedTextPropTypes.js",
208 | "node_modules/react-native/Libraries/DeprecatedPropTypes/DeprecatedStyleSheetPropType.js",
209 | "node_modules/react-native/Libraries/DeprecatedPropTypes/deprecatedCreateStrictShapeTypeChecker.js",
210 | "node_modules/react-native/Libraries/DeprecatedPropTypes/DeprecatedEdgeInsetsPropType.js",
211 | "node_modules/react-native/Libraries/Utilities/warnOnce.js",
212 | "node_modules/react-native/Libraries/Components/DatePicker/DatePickerIOS.android.js",
213 | "node_modules/react-native/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js",
214 | "node_modules/react-native/Libraries/Components/StatusBar/StatusBar.js",
215 | "node_modules/react-native/Libraries/Components/StatusBar/NativeStatusBarManagerAndroid.js",
216 | "node_modules/react-native/Libraries/Components/StatusBar/NativeStatusBarManagerIOS.js",
217 | "node_modules/react-native/Libraries/Utilities/dismissKeyboard.js",
218 | "node_modules/react-native/Libraries/Components/DrawerAndroid/AndroidDrawerLayoutNativeComponent.js",
219 | "node_modules/react-native/Libraries/Lists/FlatList.js",
220 | "node_modules/@babel/runtime/helpers/defineProperty.js",
221 | "node_modules/react-native/Libraries/Lists/VirtualizedList.js",
222 | "node_modules/react-native/Libraries/Components/ScrollView/ScrollView.js",
223 | "node_modules/react-native/Libraries/Animated/AnimatedImplementation.js",
224 | "node_modules/react-native/Libraries/Animated/nodes/AnimatedAddition.js",
225 | "node_modules/react-native/Libraries/Animated/nodes/AnimatedValue.js",
226 | "node_modules/react-native/Libraries/Animated/NativeAnimatedHelper.js",
227 | "node_modules/react-native/Libraries/Animated/NativeAnimatedModule.js",
228 | "node_modules/react-native/Libraries/Animated/NativeAnimatedTurboModule.js",
229 | "node_modules/react-native/Libraries/Animated/nodes/AnimatedInterpolation.js",
230 | "node_modules/react-native/Libraries/Animated/nodes/AnimatedWithChildren.js",
231 | "node_modules/react-native/Libraries/Animated/nodes/AnimatedNode.js",
232 | "node_modules/react-native/Libraries/Interaction/InteractionManager.js",
233 | "node_modules/react-native/Libraries/Interaction/TaskQueue.js",
234 | "node_modules/react-native/Libraries/Animated/nodes/AnimatedSubtraction.js",
235 | "node_modules/react-native/Libraries/Animated/nodes/AnimatedDivision.js",
236 | "node_modules/react-native/Libraries/Animated/nodes/AnimatedMultiplication.js",
237 | "node_modules/react-native/Libraries/Animated/nodes/AnimatedModulo.js",
238 | "node_modules/react-native/Libraries/Animated/nodes/AnimatedDiffClamp.js",
239 | "node_modules/react-native/Libraries/Animated/nodes/AnimatedValueXY.js",
240 | "node_modules/react-native/Libraries/Animated/nodes/AnimatedTracking.js",
241 | "node_modules/react-native/Libraries/Animated/animations/SpringAnimation.js",
242 | "node_modules/react-native/Libraries/Animated/SpringConfig.js",
243 | "node_modules/react-native/Libraries/Animated/animations/Animation.js",
244 | "node_modules/react-native/Libraries/Animated/animations/TimingAnimation.js",
245 | "node_modules/react-native/Libraries/Animated/Easing.js",
246 | "node_modules/react-native/Libraries/Animated/bezier.js",
247 | "node_modules/react-native/Libraries/Animated/animations/DecayAnimation.js",
248 | "node_modules/react-native/Libraries/Animated/AnimatedEvent.js",
249 | "node_modules/react-native/Libraries/Animated/createAnimatedComponent.js",
250 | "node_modules/react-native/Libraries/Utilities/setAndForwardRef.js",
251 | "node_modules/react-native/Libraries/Animated/nodes/AnimatedProps.js",
252 | "node_modules/react-native/Libraries/Animated/nodes/AnimatedStyle.js",
253 | "node_modules/react-native/Libraries/Animated/nodes/AnimatedTransform.js",
254 | "node_modules/react-native/Libraries/Components/ScrollResponder.js",
255 | "node_modules/react-native/Libraries/Components/ScrollView/ScrollViewCommands.js",
256 | "node_modules/react-native/Libraries/Interaction/FrameRateLogger.js",
257 | "node_modules/react-native/Libraries/Interaction/NativeFrameRateLogger.js",
258 | "node_modules/react-native/Libraries/Components/Keyboard/Keyboard.js",
259 | "node_modules/react-native/Libraries/LayoutAnimation/LayoutAnimation.js",
260 | "node_modules/react-native/Libraries/Components/Keyboard/NativeKeyboardObserver.js",
261 | "node_modules/react-native/Libraries/Components/ScrollView/ScrollViewStickyHeader.js",
262 | "node_modules/react-native/Libraries/Components/ScrollView/processDecelerationRate.js",
263 | "node_modules/react-native/Libraries/StyleSheet/splitLayoutProps.js",
264 | "node_modules/react-native/Libraries/Components/ScrollView/ScrollViewContext.js",
265 | "node_modules/react-native/Libraries/Components/ScrollView/ScrollViewNativeComponent.js",
266 | "node_modules/react-native/Libraries/Components/ScrollView/ScrollViewViewConfig.js",
267 | "node_modules/react-native/Libraries/Components/ScrollView/ScrollContentViewNativeComponent.js",
268 | "node_modules/react-native/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js",
269 | "node_modules/react-native/Libraries/Components/ScrollView/AndroidHorizontalScrollContentViewNativeComponent.js",
270 | "node_modules/react-native/Libraries/Components/RefreshControl/RefreshControl.js",
271 | "node_modules/react-native/Libraries/Components/RefreshControl/AndroidSwipeRefreshLayoutNativeComponent.js",
272 | "node_modules/react-native/Libraries/Components/RefreshControl/PullToRefreshViewNativeComponent.js",
273 | "node_modules/react-native/Libraries/Utilities/infoLog.js",
274 | "node_modules/react-native/Libraries/Lists/VirtualizeUtils.js",
275 | "node_modules/react-native/Libraries/Lists/FillRateHelper.js",
276 | "node_modules/react-native/Libraries/Interaction/Batchinator.js",
277 | "node_modules/react-native/Libraries/Lists/ViewabilityHelper.js",
278 | "node_modules/react-native/Libraries/Lists/VirtualizedListContext.js",
279 | "node_modules/react-native/Libraries/Image/Image.android.js",
280 | "node_modules/@babel/runtime/regenerator/index.js",
281 | "node_modules/react-native/Libraries/Image/ImageViewNativeComponent.js",
282 | "node_modules/react-native/Libraries/Image/ImageViewViewConfig.js",
283 | "node_modules/react-native/Libraries/Image/NativeImageLoaderAndroid.js",
284 | "node_modules/react-native/Libraries/DeprecatedPropTypes/DeprecatedViewPropTypes.js",
285 | "node_modules/react-native/Libraries/DeprecatedPropTypes/DeprecatedViewAccessibility.js",
286 | "node_modules/react-native/Libraries/Image/ImageAnalyticsTagContext.js",
287 | "node_modules/react-native/Libraries/Image/TextInlineImageNativeComponent.js",
288 | "node_modules/react-native/Libraries/Image/ImageBackground.js",
289 | "node_modules/react-native/Libraries/Components/TextInput/InputAccessoryView.js",
290 | "node_modules/react-native/Libraries/Components/TextInput/RCTInputAccessoryViewNativeComponent.js",
291 | "node_modules/react-native/Libraries/Components/Keyboard/KeyboardAvoidingView.js",
292 | "node_modules/react-native/Libraries/Components/MaskedView/MaskedViewIOS.android.js",
293 | "node_modules/react-native/Libraries/Components/UnimplementedViews/UnimplementedView.js",
294 | "node_modules/react-native/Libraries/Modal/Modal.js",
295 | "node_modules/react-native/Libraries/Modal/NativeModalManager.js",
296 | "node_modules/react-native/Libraries/Modal/RCTModalHostViewNativeComponent.js",
297 | "node_modules/react-native/Libraries/ReactNative/RootTag.js",
298 | "node_modules/react-native/Libraries/ReactNative/I18nManager.js",
299 | "node_modules/react-native/Libraries/ReactNative/NativeI18nManager.js",
300 | "node_modules/react-native/Libraries/Components/Picker/Picker.js",
301 | "node_modules/react-native/Libraries/Components/Picker/PickerAndroid.android.js",
302 | "node_modules/react-native/Libraries/Components/Picker/AndroidDropdownPickerNativeComponent.js",
303 | "node_modules/react-native/Libraries/Components/Picker/AndroidDialogPickerNativeComponent.js",
304 | "node_modules/react-native/Libraries/Components/Picker/AndroidDialogPickerViewConfig.js",
305 | "node_modules/react-native/Libraries/Components/Picker/PickerIOS.android.js",
306 | "node_modules/react-native/Libraries/Components/Pressable/Pressable.js",
307 | "node_modules/react-native/Libraries/Components/Pressable/useAndroidRippleForView.js",
308 | "node_modules/react-native/Libraries/Pressability/usePressability.js",
309 | "node_modules/react-native/Libraries/Components/ProgressViewIOS/ProgressViewIOS.android.js",
310 | "node_modules/react-native/Libraries/Components/SafeAreaView/SafeAreaView.js",
311 | "node_modules/react-native/Libraries/Components/SafeAreaView/RCTSafeAreaViewNativeComponent.js",
312 | "node_modules/react-native/Libraries/Lists/SectionList.js",
313 | "node_modules/react-native/Libraries/Lists/VirtualizedSectionList.js",
314 | "node_modules/react-native/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.android.js",
315 | "node_modules/react-native/Libraries/Components/Slider/Slider.js",
316 | "node_modules/react-native/Libraries/Components/Slider/SliderNativeComponent.js",
317 | "node_modules/react-native/Libraries/Components/Switch/Switch.js",
318 | "node_modules/react-native/Libraries/Components/Switch/AndroidSwitchNativeComponent.js",
319 | "node_modules/react-native/Libraries/Components/Switch/SwitchNativeComponent.js",
320 | "node_modules/react-native/Libraries/Components/TextInput/TextInput.js",
321 | "node_modules/react-native/Libraries/Components/Touchable/TouchableWithoutFeedback.js",
322 | "node_modules/react-native/Libraries/DeprecatedPropTypes/DeprecatedTextInputPropTypes.js",
323 | "node_modules/react-native/Libraries/Components/Touchable/TouchableHighlight.js",
324 | "node_modules/react-native/Libraries/Components/Touchable/TouchableOpacity.js",
325 | "node_modules/react-native/Libraries/Animated/Animated.js",
326 | "node_modules/react-native/Libraries/Animated/AnimatedMock.js",
327 | "node_modules/react-native/Libraries/Animated/components/AnimatedFlatList.js",
328 | "node_modules/react-native/Libraries/Animated/components/AnimatedImage.js",
329 | "node_modules/react-native/Libraries/Animated/components/AnimatedScrollView.js",
330 | "node_modules/react-native/Libraries/Animated/components/AnimatedSectionList.js",
331 | "node_modules/react-native/Libraries/Animated/components/AnimatedText.js",
332 | "node_modules/react-native/Libraries/Animated/components/AnimatedView.js",
333 | "node_modules/react-native/Libraries/ActionSheetIOS/ActionSheetIOS.js",
334 | "node_modules/react-native/Libraries/ActionSheetIOS/NativeActionSheetManager.js",
335 | "node_modules/react-native/Libraries/Utilities/Appearance.js",
336 | "node_modules/react-native/Libraries/Utilities/NativeAppearance.js",
337 | "node_modules/react-native/Libraries/ReactNative/AppRegistry.js",
338 | "node_modules/react-native/Libraries/ReactNative/NativeHeadlessJsTaskSupport.js",
339 | "node_modules/react-native/Libraries/ReactNative/HeadlessJsTaskError.js",
340 | "node_modules/react-native/Libraries/ReactNative/renderApplication.js",
341 | "node_modules/react-native/Libraries/Utilities/PerformanceLoggerContext.js",
342 | "node_modules/react-native/Libraries/Utilities/BackHandler.android.js",
343 | "node_modules/react-native/Libraries/NativeModules/specs/NativeDeviceEventManager.js",
344 | "node_modules/react-native/Libraries/ReactNative/AppContainer.js",
345 | "node_modules/react-native/Libraries/Renderer/shims/ReactFabric.js",
346 | "node_modules/react-native/Libraries/Renderer/implementations/ReactFabric-prod.js",
347 | "node_modules/react-native/Libraries/BugReporting/BugReporting.js",
348 | "node_modules/react-native/Libraries/NativeModules/specs/NativeRedBox.js",
349 | "node_modules/react-native/Libraries/BugReporting/NativeBugReporting.js",
350 | "node_modules/react-native/Libraries/BugReporting/dumpReactTree.js",
351 | "node_modules/react-native/Libraries/Utilities/SceneTracker.js",
352 | "node_modules/react-native/Libraries/AppState/AppState.js",
353 | "node_modules/react-native/Libraries/Utilities/logError.js",
354 | "node_modules/react-native/Libraries/AppState/NativeAppState.js",
355 | "node_modules/react-native/Libraries/Storage/AsyncStorage.js",
356 | "node_modules/react-native/Libraries/Storage/NativeAsyncLocalStorage.js",
357 | "node_modules/react-native/Libraries/Storage/NativeAsyncSQLiteDBStorage.js",
358 | "node_modules/react-native/Libraries/Components/Clipboard/Clipboard.js",
359 | "node_modules/react-native/Libraries/Components/Clipboard/NativeClipboard.js",
360 | "node_modules/react-native/Libraries/Components/DatePickerAndroid/DatePickerAndroid.android.js",
361 | "node_modules/react-native/Libraries/Components/DatePickerAndroid/NativeDatePickerAndroid.js",
362 | "node_modules/react-native/Libraries/Utilities/DeviceInfo.js",
363 | "node_modules/react-native/Libraries/Utilities/DevSettings.js",
364 | "node_modules/react-native/Libraries/NativeModules/specs/NativeDevSettings.js",
365 | "node_modules/react-native/Libraries/Image/ImagePickerIOS.js",
366 | "node_modules/react-native/Libraries/Image/NativeImagePickerIOS.js",
367 | "node_modules/react-native/Libraries/Linking/Linking.js",
368 | "node_modules/react-native/Libraries/Linking/NativeLinkingManager.js",
369 | "node_modules/react-native/Libraries/Linking/NativeIntentAndroid.js",
370 | "node_modules/react-native/Libraries/LogBox/LogBox.js",
371 | "node_modules/react-native/Libraries/Interaction/PanResponder.js",
372 | "node_modules/react-native/Libraries/Interaction/TouchHistoryMath.js",
373 | "node_modules/react-native/Libraries/PermissionsAndroid/PermissionsAndroid.js",
374 | "node_modules/react-native/Libraries/PermissionsAndroid/NativePermissionsAndroid.js",
375 | "node_modules/react-native/Libraries/PushNotificationIOS/PushNotificationIOS.js",
376 | "node_modules/react-native/Libraries/PushNotificationIOS/NativePushNotificationManagerIOS.js",
377 | "node_modules/react-native/Libraries/Settings/Settings.android.js",
378 | "node_modules/react-native/Libraries/Share/Share.js",
379 | "node_modules/react-native/Libraries/Share/NativeShareModule.js",
380 | "node_modules/react-native/Libraries/Components/StatusBar/StatusBarIOS.js",
381 | "node_modules/react-native/Libraries/Components/ToastAndroid/ToastAndroid.android.js",
382 | "node_modules/react-native/Libraries/Components/ToastAndroid/NativeToastAndroid.js",
383 | "node_modules/react-native/Libraries/Utilities/useColorScheme.js",
384 | "node_modules/use-subscription/index.js",
385 | "node_modules/use-subscription/cjs/use-subscription.production.min.js",
386 | "node_modules/react-native/Libraries/Utilities/useWindowDimensions.js",
387 | "node_modules/react-native/Libraries/UTFSequence.js",
388 | "node_modules/react-native/Libraries/Vibration/Vibration.js",
389 | "node_modules/react-native/Libraries/Vibration/NativeVibration.js",
390 | "node_modules/react-native/Libraries/YellowBox/YellowBoxDeprecated.js",
391 | "node_modules/react-native/Libraries/StyleSheet/PlatformColorValueTypesIOS.js",
392 | "node_modules/react-native/Libraries/DeprecatedPropTypes/DeprecatedPointPropType.js"
393 | ]
--------------------------------------------------------------------------------
/Example/public/dll/_dll.ios.json:
--------------------------------------------------------------------------------
1 | [
2 | "__prelude__",
3 | "node_modules/metro-runtime/src/polyfills/require.js",
4 | "node_modules/@react-native/polyfills/console.js",
5 | "node_modules/@react-native/polyfills/error-guard.js",
6 | "node_modules/@react-native/polyfills/Object.es7.js",
7 | "require-node_modules/react-native/Libraries/Core/InitializeCore.js",
8 | "node_modules/react-native/index.js",
9 | "node_modules/react-native/Libraries/Components/AccessibilityInfo/AccessibilityInfo.ios.js",
10 | "node_modules/@babel/runtime/helpers/interopRequireDefault.js",
11 | "node_modules/react-native/Libraries/EventEmitter/RCTDeviceEventEmitter.js",
12 | "node_modules/@babel/runtime/helpers/classCallCheck.js",
13 | "node_modules/@babel/runtime/helpers/createClass.js",
14 | "node_modules/@babel/runtime/helpers/get.js",
15 | "node_modules/@babel/runtime/helpers/superPropBase.js",
16 | "node_modules/@babel/runtime/helpers/getPrototypeOf.js",
17 | "node_modules/@babel/runtime/helpers/inherits.js",
18 | "node_modules/@babel/runtime/helpers/setPrototypeOf.js",
19 | "node_modules/@babel/runtime/helpers/possibleConstructorReturn.js",
20 | "node_modules/@babel/runtime/helpers/typeof.js",
21 | "node_modules/@babel/runtime/helpers/assertThisInitialized.js",
22 | "node_modules/react-native/Libraries/vendor/emitter/EventEmitter.js",
23 | "node_modules/react-native/Libraries/vendor/emitter/_EventEmitter.js",
24 | "node_modules/react-native/Libraries/vendor/emitter/_EmitterSubscription.js",
25 | "node_modules/react-native/Libraries/vendor/emitter/_EventSubscription.js",
26 | "node_modules/react-native/Libraries/vendor/emitter/_EventSubscriptionVendor.js",
27 | "node_modules/invariant/browser.js",
28 | "node_modules/react-native/Libraries/Components/AccessibilityInfo/NativeAccessibilityManager.js",
29 | "node_modules/react-native/Libraries/TurboModule/TurboModuleRegistry.js",
30 | "node_modules/react-native/Libraries/BatchedBridge/NativeModules.js",
31 | "node_modules/@babel/runtime/helpers/slicedToArray.js",
32 | "node_modules/@babel/runtime/helpers/arrayWithHoles.js",
33 | "node_modules/@babel/runtime/helpers/iterableToArrayLimit.js",
34 | "node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js",
35 | "node_modules/@babel/runtime/helpers/arrayLikeToArray.js",
36 | "node_modules/@babel/runtime/helpers/nonIterableRest.js",
37 | "node_modules/@babel/runtime/helpers/extends.js",
38 | "node_modules/react-native/Libraries/BatchedBridge/BatchedBridge.js",
39 | "node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js",
40 | "node_modules/react-native/Libraries/Performance/Systrace.js",
41 | "node_modules/react-native/Libraries/vendor/core/ErrorUtils.js",
42 | "node_modules/react-native/Libraries/Utilities/stringifySafe.js",
43 | "node_modules/@babel/runtime/helpers/toConsumableArray.js",
44 | "node_modules/@babel/runtime/helpers/arrayWithoutHoles.js",
45 | "node_modules/@babel/runtime/helpers/iterableToArray.js",
46 | "node_modules/@babel/runtime/helpers/nonIterableSpread.js",
47 | "node_modules/react-native/Libraries/Utilities/defineLazyObjectProperty.js",
48 | "node_modules/react-native/Libraries/Components/ActivityIndicator/ActivityIndicator.js",
49 | "node_modules/react/index.js",
50 | "node_modules/react/cjs/react.production.min.js",
51 | "node_modules/object-assign/index.js",
52 | "node_modules/react-native/Libraries/Components/ActivityIndicator/ActivityIndicatorViewNativeComponent.js",
53 | "node_modules/react-native/Libraries/Utilities/codegenNativeComponent.js",
54 | "node_modules/react-native/Libraries/ReactNative/requireNativeComponent.js",
55 | "node_modules/react-native/Libraries/Renderer/shims/createReactNativeComponentClass.js",
56 | "node_modules/react-native/Libraries/ReactPrivate/ReactNativePrivateInterface.js",
57 | "node_modules/react-native/Libraries/Core/ExceptionsManager.js",
58 | "node_modules/@babel/runtime/helpers/wrapNativeSuper.js",
59 | "node_modules/@babel/runtime/helpers/isNativeFunction.js",
60 | "node_modules/@babel/runtime/helpers/construct.js",
61 | "node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js",
62 | "node_modules/react-native/Libraries/Core/NativeExceptionsManager.js",
63 | "node_modules/react-native/Libraries/Core/Devtools/parseErrorStack.js",
64 | "node_modules/stacktrace-parser/dist/stack-trace-parser.cjs.js",
65 | "node_modules/react-native/Libraries/Core/Devtools/parseHermesStack.js",
66 | "node_modules/react-native/Libraries/Utilities/Platform.ios.js",
67 | "node_modules/react-native/Libraries/Utilities/NativePlatformConstantsIOS.js",
68 | "node_modules/react-native/Libraries/EventEmitter/RCTEventEmitter.js",
69 | "node_modules/react-native/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js",
70 | "node_modules/react-native/Libraries/Components/TextInput/TextInputState.js",
71 | "node_modules/react-native/Libraries/Renderer/shims/ReactNative.js",
72 | "node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js",
73 | "node_modules/react-native/Libraries/ReactPrivate/ReactNativePrivateInitializeCore.js",
74 | "node_modules/react-native/Libraries/Core/InitializeCore.js",
75 | "node_modules/react-native/Libraries/Core/setUpGlobals.js",
76 | "node_modules/react-native/Libraries/Core/setUpPerformance.js",
77 | "node_modules/react-native/Libraries/Core/setUpSystrace.js",
78 | "node_modules/react-native/Libraries/Core/setUpErrorHandling.js",
79 | "node_modules/react-native/Libraries/Core/polyfillPromise.js",
80 | "node_modules/react-native/Libraries/Utilities/PolyfillFunctions.js",
81 | "node_modules/react-native/Libraries/Promise.js",
82 | "node_modules/promise/setimmediate/done.js",
83 | "node_modules/promise/setimmediate/core.js",
84 | "node_modules/promise/setimmediate/finally.js",
85 | "node_modules/promise/setimmediate/es6-extensions.js",
86 | "node_modules/react-native/Libraries/Core/setUpRegeneratorRuntime.js",
87 | "node_modules/regenerator-runtime/runtime.js",
88 | "node_modules/react-native/Libraries/Core/setUpTimers.js",
89 | "node_modules/react-native/Libraries/Core/Timers/JSTimers.js",
90 | "node_modules/react-native/Libraries/Core/Timers/NativeTiming.js",
91 | "node_modules/react-native/Libraries/Core/setUpXHR.js",
92 | "node_modules/react-native/Libraries/Network/XMLHttpRequest.js",
93 | "node_modules/react-native/Libraries/Blob/BlobManager.js",
94 | "node_modules/react-native/Libraries/Blob/NativeBlobModule.js",
95 | "node_modules/react-native/Libraries/Blob/Blob.js",
96 | "node_modules/react-native/Libraries/Blob/BlobRegistry.js",
97 | "node_modules/event-target-shim/dist/event-target-shim.js",
98 | "node_modules/react-native/Libraries/Utilities/GlobalPerformanceLogger.js",
99 | "node_modules/react-native/Libraries/Utilities/createPerformanceLogger.js",
100 | "node_modules/base64-js/index.js",
101 | "node_modules/react-native/Libraries/Network/RCTNetworking.ios.js",
102 | "node_modules/react-native/Libraries/EventEmitter/NativeEventEmitter.js",
103 | "node_modules/react-native/Libraries/Network/NativeNetworkingIOS.js",
104 | "node_modules/react-native/Libraries/Network/convertRequestBody.js",
105 | "node_modules/react-native/Libraries/Network/FormData.js",
106 | "node_modules/react-native/Libraries/Utilities/binaryToBase64.js",
107 | "node_modules/react-native/Libraries/Network/fetch.js",
108 | "node_modules/whatwg-fetch/dist/fetch.umd.js",
109 | "node_modules/react-native/Libraries/WebSocket/WebSocket.js",
110 | "node_modules/@babel/runtime/helpers/objectWithoutProperties.js",
111 | "node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js",
112 | "node_modules/react-native/Libraries/WebSocket/NativeWebSocketModule.js",
113 | "node_modules/react-native/Libraries/WebSocket/WebSocketEvent.js",
114 | "node_modules/react-native/Libraries/Blob/File.js",
115 | "node_modules/react-native/Libraries/Blob/FileReader.js",
116 | "node_modules/react-native/Libraries/Blob/NativeFileReaderModule.js",
117 | "node_modules/react-native/Libraries/Blob/URL.js",
118 | "node_modules/abort-controller/dist/abort-controller.js",
119 | "node_modules/react-native/Libraries/Core/setUpAlert.js",
120 | "node_modules/react-native/Libraries/Alert/Alert.js",
121 | "node_modules/react-native/Libraries/NativeModules/specs/NativeDialogManagerAndroid.js",
122 | "node_modules/react-native/Libraries/Alert/RCTAlertManager.ios.js",
123 | "node_modules/react-native/Libraries/Alert/NativeAlertManager.js",
124 | "node_modules/react-native/Libraries/Core/setUpNavigator.js",
125 | "node_modules/react-native/Libraries/Core/setUpBatchedBridge.js",
126 | "node_modules/react-native/Libraries/HeapCapture/HeapCapture.js",
127 | "node_modules/react-native/Libraries/HeapCapture/NativeJSCHeapCapture.js",
128 | "node_modules/react-native/Libraries/Performance/SamplingProfiler.js",
129 | "node_modules/react-native/Libraries/Performance/NativeJSCSamplingProfiler.js",
130 | "node_modules/react-native/Libraries/Utilities/RCTLog.js",
131 | "node_modules/react-native/Libraries/EventEmitter/RCTNativeAppEventEmitter.js",
132 | "node_modules/react-native/Libraries/Utilities/JSDevSupportModule.js",
133 | "node_modules/react-native/Libraries/Utilities/NativeJSDevSupport.js",
134 | "node_modules/react-native/Libraries/Utilities/HMRClientProdShim.js",
135 | "node_modules/react-native/Libraries/Core/setUpSegmentFetcher.js",
136 | "node_modules/react-native/Libraries/Core/SegmentFetcher/NativeSegmentFetcher.js",
137 | "node_modules/scheduler/index.js",
138 | "node_modules/scheduler/cjs/scheduler.production.min.js",
139 | "node_modules/react-native/Libraries/Components/TextInput/RCTSingelineTextInputNativeComponent.js",
140 | "node_modules/react-native/Libraries/Utilities/codegenNativeCommands.js",
141 | "node_modules/react-native/Libraries/Components/TextInput/RCTSinglelineTextInputViewConfig.js",
142 | "node_modules/react-native/Libraries/Components/View/ReactNativeViewViewConfig.js",
143 | "node_modules/react-native/Libraries/Components/View/ReactNativeViewViewConfigAndroid.js",
144 | "node_modules/react-native/Libraries/StyleSheet/processColor.js",
145 | "node_modules/react-native/Libraries/StyleSheet/normalizeColor.js",
146 | "node_modules/@react-native/normalize-color/base.js",
147 | "node_modules/react-native/Libraries/StyleSheet/PlatformColorValueTypes.ios.js",
148 | "node_modules/react-native/Libraries/Utilities/differ/insetsDiffer.js",
149 | "node_modules/react-native/Libraries/Utilities/differ/sizesDiffer.js",
150 | "node_modules/react-native/Libraries/Utilities/differ/matricesDiffer.js",
151 | "node_modules/react-native/Libraries/StyleSheet/processTransform.js",
152 | "node_modules/react-native/Libraries/Utilities/MatrixMath.js",
153 | "node_modules/react-native/Libraries/ReactNative/UIManager.js",
154 | "node_modules/react-native/Libraries/ReactNative/DummyUIManager.js",
155 | "node_modules/react-native/Libraries/ReactNative/PaperUIManager.js",
156 | "node_modules/react-native/Libraries/ReactNative/NativeUIManager.js",
157 | "node_modules/react-native/Libraries/ReactNative/UIManagerProperties.js",
158 | "node_modules/react-native/Libraries/Utilities/differ/deepDiffer.js",
159 | "node_modules/react-native/Libraries/Utilities/deepFreezeAndThrowOnMutationInDev.js",
160 | "node_modules/react-native/Libraries/StyleSheet/flattenStyle.js",
161 | "node_modules/react-native/Libraries/Core/ReactFiberErrorDialog.js",
162 | "node_modules/react-native/Libraries/ReactNative/getNativeComponentAttributes.js",
163 | "node_modules/react-native/Libraries/Components/View/ReactNativeStyleAttributes.js",
164 | "node_modules/react-native/Libraries/DeprecatedPropTypes/DeprecatedViewStylePropTypes.js",
165 | "node_modules/react-native/Libraries/DeprecatedPropTypes/DeprecatedLayoutPropTypes.js",
166 | "node_modules/prop-types/index.js",
167 | "node_modules/prop-types/factoryWithThrowingShims.js",
168 | "node_modules/prop-types/lib/ReactPropTypesSecret.js",
169 | "node_modules/react-native/Libraries/DeprecatedPropTypes/DeprecatedShadowPropTypesIOS.js",
170 | "node_modules/react-native/Libraries/DeprecatedPropTypes/DeprecatedColorPropType.js",
171 | "node_modules/react-native/Libraries/DeprecatedPropTypes/DeprecatedTransformPropTypes.js",
172 | "node_modules/react-native/Libraries/Utilities/deprecatedPropType.js",
173 | "node_modules/react-native/Libraries/DeprecatedPropTypes/DeprecatedTextStylePropTypes.js",
174 | "node_modules/react-native/Libraries/DeprecatedPropTypes/DeprecatedImageStylePropTypes.js",
175 | "node_modules/react-native/Libraries/Utilities/differ/pointsDiffer.js",
176 | "node_modules/react-native/Libraries/StyleSheet/processColorArray.js",
177 | "node_modules/react-native/Libraries/Image/resolveAssetSource.js",
178 | "node_modules/react-native/Libraries/NativeModules/specs/NativeSourceCode.js",
179 | "node_modules/@react-native/assets/registry.js",
180 | "node_modules/react-native/Libraries/Image/AssetSourceResolver.js",
181 | "node_modules/react-native/Libraries/Utilities/PixelRatio.js",
182 | "node_modules/react-native/Libraries/Utilities/Dimensions.js",
183 | "node_modules/react-native/Libraries/Utilities/NativeDeviceInfo.js",
184 | "node_modules/@react-native/assets/path-support.js",
185 | "node_modules/react-native/Libraries/Components/View/View.js",
186 | "node_modules/react-native/Libraries/Components/View/ViewNativeComponent.js",
187 | "node_modules/react-native/Libraries/Utilities/registerGeneratedViewConfig.js",
188 | "node_modules/react-native/Libraries/Utilities/verifyComponentAttributeEquivalence.js",
189 | "node_modules/react-native/Libraries/Text/TextAncestor.js",
190 | "node_modules/react-native/Libraries/StyleSheet/StyleSheet.js",
191 | "node_modules/react-native/Libraries/Components/Button.js",
192 | "node_modules/react-native/Libraries/Components/Touchable/TouchableOpacity.js",
193 | "node_modules/react-native/Libraries/Pressability/Pressability.js",
194 | "node_modules/react-native/Libraries/Components/Sound/SoundManager.js",
195 | "node_modules/react-native/Libraries/Components/Sound/NativeSoundManager.js",
196 | "node_modules/react-native/Libraries/Pressability/HoverState.js",
197 | "node_modules/react-native/Libraries/StyleSheet/Rect.js",
198 | "node_modules/react-native/Libraries/Animated/Animated.js",
199 | "node_modules/react-native/Libraries/Animated/AnimatedMock.js",
200 | "node_modules/react-native/Libraries/Animated/nodes/AnimatedValue.js",
201 | "node_modules/react-native/Libraries/Animated/NativeAnimatedHelper.js",
202 | "node_modules/react-native/Libraries/Animated/NativeAnimatedModule.js",
203 | "node_modules/react-native/Libraries/Animated/NativeAnimatedTurboModule.js",
204 | "node_modules/react-native/Libraries/Animated/nodes/AnimatedInterpolation.js",
205 | "node_modules/react-native/Libraries/Animated/nodes/AnimatedWithChildren.js",
206 | "node_modules/react-native/Libraries/Animated/nodes/AnimatedNode.js",
207 | "node_modules/react-native/Libraries/Interaction/InteractionManager.js",
208 | "node_modules/react-native/Libraries/Interaction/TaskQueue.js",
209 | "node_modules/react-native/Libraries/Animated/nodes/AnimatedValueXY.js",
210 | "node_modules/react-native/Libraries/Animated/AnimatedImplementation.js",
211 | "node_modules/react-native/Libraries/Animated/nodes/AnimatedAddition.js",
212 | "node_modules/react-native/Libraries/Animated/nodes/AnimatedSubtraction.js",
213 | "node_modules/react-native/Libraries/Animated/nodes/AnimatedDivision.js",
214 | "node_modules/react-native/Libraries/Animated/nodes/AnimatedMultiplication.js",
215 | "node_modules/react-native/Libraries/Animated/nodes/AnimatedModulo.js",
216 | "node_modules/react-native/Libraries/Animated/nodes/AnimatedDiffClamp.js",
217 | "node_modules/react-native/Libraries/Animated/nodes/AnimatedTracking.js",
218 | "node_modules/react-native/Libraries/Animated/animations/SpringAnimation.js",
219 | "node_modules/react-native/Libraries/Animated/SpringConfig.js",
220 | "node_modules/react-native/Libraries/Animated/animations/Animation.js",
221 | "node_modules/react-native/Libraries/Animated/animations/TimingAnimation.js",
222 | "node_modules/react-native/Libraries/Animated/Easing.js",
223 | "node_modules/react-native/Libraries/Animated/bezier.js",
224 | "node_modules/react-native/Libraries/Animated/animations/DecayAnimation.js",
225 | "node_modules/react-native/Libraries/Animated/AnimatedEvent.js",
226 | "node_modules/react-native/Libraries/Animated/createAnimatedComponent.js",
227 | "node_modules/react-native/Libraries/Utilities/setAndForwardRef.js",
228 | "node_modules/react-native/Libraries/Animated/nodes/AnimatedProps.js",
229 | "node_modules/react-native/Libraries/Animated/nodes/AnimatedStyle.js",
230 | "node_modules/react-native/Libraries/Animated/nodes/AnimatedTransform.js",
231 | "node_modules/react-native/Libraries/Animated/components/AnimatedFlatList.js",
232 | "node_modules/react-native/Libraries/Lists/FlatList.js",
233 | "node_modules/@babel/runtime/helpers/defineProperty.js",
234 | "node_modules/react-native/Libraries/Lists/VirtualizedList.js",
235 | "node_modules/react-native/Libraries/Components/ScrollView/ScrollView.js",
236 | "node_modules/react-native/Libraries/Components/ScrollResponder.js",
237 | "node_modules/react-native/Libraries/Components/ScrollView/ScrollViewCommands.js",
238 | "node_modules/react-native/Libraries/Interaction/FrameRateLogger.js",
239 | "node_modules/react-native/Libraries/Interaction/NativeFrameRateLogger.js",
240 | "node_modules/react-native/Libraries/Components/Keyboard/Keyboard.js",
241 | "node_modules/react-native/Libraries/LayoutAnimation/LayoutAnimation.js",
242 | "node_modules/react-native/Libraries/Utilities/dismissKeyboard.js",
243 | "node_modules/react-native/Libraries/Components/Keyboard/NativeKeyboardObserver.js",
244 | "node_modules/react-native/Libraries/Components/ScrollView/ScrollViewStickyHeader.js",
245 | "node_modules/react-native/Libraries/Components/ScrollView/processDecelerationRate.js",
246 | "node_modules/react-native/Libraries/StyleSheet/splitLayoutProps.js",
247 | "node_modules/react-native/Libraries/Components/ScrollView/ScrollViewContext.js",
248 | "node_modules/react-native/Libraries/Components/ScrollView/ScrollViewNativeComponent.js",
249 | "node_modules/react-native/Libraries/Components/ScrollView/ScrollViewViewConfig.js",
250 | "node_modules/react-native/Libraries/Components/ScrollView/ScrollContentViewNativeComponent.js",
251 | "node_modules/react-native/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js",
252 | "node_modules/react-native/Libraries/Components/ScrollView/AndroidHorizontalScrollContentViewNativeComponent.js",
253 | "node_modules/react-native/Libraries/Components/RefreshControl/RefreshControl.js",
254 | "node_modules/react-native/Libraries/Components/RefreshControl/AndroidSwipeRefreshLayoutNativeComponent.js",
255 | "node_modules/react-native/Libraries/Components/RefreshControl/PullToRefreshViewNativeComponent.js",
256 | "node_modules/react-native/Libraries/Utilities/infoLog.js",
257 | "node_modules/react-native/Libraries/Lists/VirtualizeUtils.js",
258 | "node_modules/react-native/Libraries/Lists/FillRateHelper.js",
259 | "node_modules/react-native/Libraries/Interaction/Batchinator.js",
260 | "node_modules/react-native/Libraries/Lists/ViewabilityHelper.js",
261 | "node_modules/react-native/Libraries/Lists/VirtualizedListContext.js",
262 | "node_modules/react-native/Libraries/Animated/components/AnimatedImage.js",
263 | "node_modules/react-native/Libraries/Image/Image.ios.js",
264 | "node_modules/@babel/runtime/regenerator/index.js",
265 | "node_modules/react-native/Libraries/Image/NativeImageLoaderIOS.js",
266 | "node_modules/react-native/Libraries/Image/ImageViewNativeComponent.js",
267 | "node_modules/react-native/Libraries/Image/ImageViewViewConfig.js",
268 | "node_modules/react-native/Libraries/Image/ImageAnalyticsTagContext.js",
269 | "node_modules/react-native/Libraries/DeprecatedPropTypes/DeprecatedImagePropType.js",
270 | "node_modules/react-native/Libraries/DeprecatedPropTypes/DeprecatedStyleSheetPropType.js",
271 | "node_modules/react-native/Libraries/DeprecatedPropTypes/deprecatedCreateStrictShapeTypeChecker.js",
272 | "node_modules/react-native/Libraries/DeprecatedPropTypes/DeprecatedImageSourcePropType.js",
273 | "node_modules/react-native/Libraries/DeprecatedPropTypes/DeprecatedEdgeInsetsPropType.js",
274 | "node_modules/react-native/Libraries/Animated/components/AnimatedScrollView.js",
275 | "node_modules/react-native/Libraries/Animated/components/AnimatedSectionList.js",
276 | "node_modules/react-native/Libraries/Lists/SectionList.js",
277 | "node_modules/react-native/Libraries/Lists/VirtualizedSectionList.js",
278 | "node_modules/react-native/Libraries/Animated/components/AnimatedText.js",
279 | "node_modules/react-native/Libraries/Text/Text.js",
280 | "node_modules/react-native/Libraries/Text/TextInjection.js",
281 | "node_modules/react-native/Libraries/Components/Touchable/Touchable.js",
282 | "node_modules/react-native/Libraries/Components/Touchable/Position.js",
283 | "node_modules/react-native/Libraries/Components/Touchable/PooledClass.js",
284 | "node_modules/react-native/Libraries/Components/Touchable/BoundingDimensions.js",
285 | "node_modules/react-native/Libraries/Text/TextNativeComponent.js",
286 | "node_modules/react-native/Libraries/Components/View/ReactNativeViewAttributes.js",
287 | "node_modules/nullthrows/nullthrows.js",
288 | "node_modules/react-native/Libraries/DeprecatedPropTypes/DeprecatedTextPropTypes.js",
289 | "node_modules/react-native/Libraries/Animated/components/AnimatedView.js",
290 | "node_modules/react-native/Libraries/Utilities/warnOnce.js",
291 | "node_modules/react-native/Libraries/Components/DatePicker/DatePickerIOS.ios.js",
292 | "node_modules/react-native/Libraries/Components/DatePicker/RCTDatePickerNativeComponent.js",
293 | "node_modules/react-native/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.ios.js",
294 | "node_modules/react-native/Libraries/Components/UnimplementedViews/UnimplementedView.js",
295 | "node_modules/react-native/Libraries/Image/ImageBackground.js",
296 | "node_modules/react-native/Libraries/Components/TextInput/InputAccessoryView.js",
297 | "node_modules/react-native/Libraries/Components/TextInput/RCTInputAccessoryViewNativeComponent.js",
298 | "node_modules/react-native/Libraries/Components/Keyboard/KeyboardAvoidingView.js",
299 | "node_modules/react-native/Libraries/Components/MaskedView/MaskedViewIOS.ios.js",
300 | "node_modules/react-native/Libraries/Components/MaskedView/RCTMaskedViewNativeComponent.js",
301 | "node_modules/react-native/Libraries/Modal/Modal.js",
302 | "node_modules/react-native/Libraries/Modal/NativeModalManager.js",
303 | "node_modules/react-native/Libraries/Modal/RCTModalHostViewNativeComponent.js",
304 | "node_modules/react-native/Libraries/ReactNative/RootTag.js",
305 | "node_modules/react-native/Libraries/ReactNative/I18nManager.js",
306 | "node_modules/react-native/Libraries/ReactNative/NativeI18nManager.js",
307 | "node_modules/react-native/Libraries/Components/Picker/Picker.js",
308 | "node_modules/react-native/Libraries/Components/Picker/PickerIOS.ios.js",
309 | "node_modules/react-native/Libraries/Components/Picker/RCTPickerNativeComponent.js",
310 | "node_modules/react-native/Libraries/Components/Picker/RCTPickerViewConfig.js",
311 | "node_modules/react-native/Libraries/Components/Pressable/Pressable.js",
312 | "node_modules/react-native/Libraries/Components/Pressable/useAndroidRippleForView.js",
313 | "node_modules/react-native/Libraries/Pressability/usePressability.js",
314 | "node_modules/react-native/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.ios.js",
315 | "node_modules/react-native/Libraries/Components/ProgressViewIOS/ProgressViewIOS.ios.js",
316 | "node_modules/react-native/Libraries/Components/ProgressViewIOS/RCTProgressViewNativeComponent.js",
317 | "node_modules/react-native/Libraries/Components/SafeAreaView/SafeAreaView.js",
318 | "node_modules/react-native/Libraries/Components/SafeAreaView/RCTSafeAreaViewNativeComponent.js",
319 | "node_modules/react-native/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.ios.js",
320 | "node_modules/react-native/Libraries/Components/SegmentedControlIOS/RCTSegmentedControlNativeComponent.js",
321 | "node_modules/react-native/Libraries/Components/Slider/Slider.js",
322 | "node_modules/react-native/Libraries/Components/Slider/SliderNativeComponent.js",
323 | "node_modules/react-native/Libraries/Components/StatusBar/StatusBar.js",
324 | "node_modules/react-native/Libraries/Components/StatusBar/NativeStatusBarManagerAndroid.js",
325 | "node_modules/react-native/Libraries/Components/StatusBar/NativeStatusBarManagerIOS.js",
326 | "node_modules/react-native/Libraries/Components/Switch/Switch.js",
327 | "node_modules/react-native/Libraries/Components/Switch/AndroidSwitchNativeComponent.js",
328 | "node_modules/react-native/Libraries/Components/Switch/SwitchNativeComponent.js",
329 | "node_modules/react-native/Libraries/Components/TextInput/TextInput.js",
330 | "node_modules/react-native/Libraries/Components/TextInput/RCTMultilineTextInputNativeComponent.js",
331 | "node_modules/react-native/Libraries/Components/Touchable/TouchableWithoutFeedback.js",
332 | "node_modules/react-native/Libraries/DeprecatedPropTypes/DeprecatedTextInputPropTypes.js",
333 | "node_modules/react-native/Libraries/DeprecatedPropTypes/DeprecatedViewPropTypes.js",
334 | "node_modules/react-native/Libraries/DeprecatedPropTypes/DeprecatedViewAccessibility.js",
335 | "node_modules/react-native/Libraries/Components/Touchable/TouchableHighlight.js",
336 | "node_modules/react-native/Libraries/Components/Touchable/TouchableNativeFeedback.js",
337 | "node_modules/react-native/Libraries/ActionSheetIOS/ActionSheetIOS.js",
338 | "node_modules/react-native/Libraries/ActionSheetIOS/NativeActionSheetManager.js",
339 | "node_modules/react-native/Libraries/Utilities/Appearance.js",
340 | "node_modules/react-native/Libraries/Utilities/NativeAppearance.js",
341 | "node_modules/react-native/Libraries/ReactNative/AppRegistry.js",
342 | "node_modules/react-native/Libraries/ReactNative/NativeHeadlessJsTaskSupport.js",
343 | "node_modules/react-native/Libraries/ReactNative/HeadlessJsTaskError.js",
344 | "node_modules/react-native/Libraries/ReactNative/renderApplication.js",
345 | "node_modules/react-native/Libraries/Utilities/PerformanceLoggerContext.js",
346 | "node_modules/react-native/Libraries/Utilities/BackHandler.ios.js",
347 | "node_modules/react-native/Libraries/ReactNative/AppContainer.js",
348 | "node_modules/react-native/Libraries/Renderer/shims/ReactFabric.js",
349 | "node_modules/react-native/Libraries/Renderer/implementations/ReactFabric-prod.js",
350 | "node_modules/react-native/Libraries/BugReporting/BugReporting.js",
351 | "node_modules/react-native/Libraries/NativeModules/specs/NativeRedBox.js",
352 | "node_modules/react-native/Libraries/BugReporting/NativeBugReporting.js",
353 | "node_modules/react-native/Libraries/BugReporting/dumpReactTree.js",
354 | "node_modules/react-native/Libraries/Utilities/SceneTracker.js",
355 | "node_modules/react-native/Libraries/AppState/AppState.js",
356 | "node_modules/react-native/Libraries/Utilities/logError.js",
357 | "node_modules/react-native/Libraries/AppState/NativeAppState.js",
358 | "node_modules/react-native/Libraries/Storage/AsyncStorage.js",
359 | "node_modules/react-native/Libraries/Storage/NativeAsyncLocalStorage.js",
360 | "node_modules/react-native/Libraries/Storage/NativeAsyncSQLiteDBStorage.js",
361 | "node_modules/react-native/Libraries/Components/Clipboard/Clipboard.js",
362 | "node_modules/react-native/Libraries/Components/Clipboard/NativeClipboard.js",
363 | "node_modules/react-native/Libraries/Components/DatePickerAndroid/DatePickerAndroid.ios.js",
364 | "node_modules/react-native/Libraries/Utilities/DeviceInfo.js",
365 | "node_modules/react-native/Libraries/Utilities/DevSettings.js",
366 | "node_modules/react-native/Libraries/NativeModules/specs/NativeDevSettings.js",
367 | "node_modules/react-native/Libraries/Image/ImagePickerIOS.js",
368 | "node_modules/react-native/Libraries/Image/NativeImagePickerIOS.js",
369 | "node_modules/react-native/Libraries/Linking/Linking.js",
370 | "node_modules/react-native/Libraries/Linking/NativeLinkingManager.js",
371 | "node_modules/react-native/Libraries/Linking/NativeIntentAndroid.js",
372 | "node_modules/react-native/Libraries/LogBox/LogBox.js",
373 | "node_modules/react-native/Libraries/Interaction/PanResponder.js",
374 | "node_modules/react-native/Libraries/Interaction/TouchHistoryMath.js",
375 | "node_modules/react-native/Libraries/PermissionsAndroid/PermissionsAndroid.js",
376 | "node_modules/react-native/Libraries/PermissionsAndroid/NativePermissionsAndroid.js",
377 | "node_modules/react-native/Libraries/PushNotificationIOS/PushNotificationIOS.js",
378 | "node_modules/react-native/Libraries/PushNotificationIOS/NativePushNotificationManagerIOS.js",
379 | "node_modules/react-native/Libraries/Settings/Settings.ios.js",
380 | "node_modules/react-native/Libraries/Settings/NativeSettingsManager.js",
381 | "node_modules/react-native/Libraries/Share/Share.js",
382 | "node_modules/react-native/Libraries/Share/NativeShareModule.js",
383 | "node_modules/react-native/Libraries/Components/StatusBar/StatusBarIOS.js",
384 | "node_modules/react-native/Libraries/Components/ToastAndroid/ToastAndroid.ios.js",
385 | "node_modules/react-native/Libraries/Utilities/useColorScheme.js",
386 | "node_modules/use-subscription/index.js",
387 | "node_modules/use-subscription/cjs/use-subscription.production.min.js",
388 | "node_modules/react-native/Libraries/Utilities/useWindowDimensions.js",
389 | "node_modules/react-native/Libraries/UTFSequence.js",
390 | "node_modules/react-native/Libraries/Vibration/Vibration.js",
391 | "node_modules/react-native/Libraries/Vibration/NativeVibration.js",
392 | "node_modules/react-native/Libraries/YellowBox/YellowBoxDeprecated.js",
393 | "node_modules/react-native/Libraries/StyleSheet/PlatformColorValueTypesIOS.ios.js",
394 | "node_modules/react-native/Libraries/DeprecatedPropTypes/DeprecatedPointPropType.js"
395 | ]
--------------------------------------------------------------------------------
/Example/public/dll/_pre.android.json:
--------------------------------------------------------------------------------
1 | [
2 | "__prelude__",
3 | "node_modules/metro-runtime/src/polyfills/require.js",
4 | "node_modules/@react-native/polyfills/console.js",
5 | "node_modules/@react-native/polyfills/error-guard.js",
6 | "node_modules/@react-native/polyfills/Object.es7.js"
7 | ]
--------------------------------------------------------------------------------
/Example/public/dll/_pre.ios.json:
--------------------------------------------------------------------------------
1 | [
2 | "__prelude__",
3 | "node_modules/metro-runtime/src/polyfills/require.js",
4 | "node_modules/@react-native/polyfills/console.js",
5 | "node_modules/@react-native/polyfills/error-guard.js",
6 | "node_modules/@react-native/polyfills/Object.es7.js"
7 | ]
--------------------------------------------------------------------------------
/Example/src/App.tsx:
--------------------------------------------------------------------------------
1 | import React, { Suspense, lazy } from 'react'
2 | import { Text } from 'react-native'
3 | import { NavigationContainer } from '@react-navigation/native'
4 | import { createStackNavigator } from '@react-navigation/stack'
5 | import Main from './views/Main'
6 | import { Views, RootStackParamList } from './types'
7 |
8 | const Stack = createStackNavigator()
9 | const Foo = lazy(() => import('./views/Foo'))
10 | const Bar = lazy(() => import('./views/Bar'))
11 |
12 | const App = () => (
13 | Loading...}>
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 | )
23 |
24 | export default App
25 |
--------------------------------------------------------------------------------
/Example/src/common/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wuba/metro-code-split/933a70acbf2b6a8d694bbcdcdd5a24c9bb14cc99/Example/src/common/.gitkeep
--------------------------------------------------------------------------------
/Example/src/components/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wuba/metro-code-split/933a70acbf2b6a8d694bbcdcdd5a24c9bb14cc99/Example/src/components/.gitkeep
--------------------------------------------------------------------------------
/Example/src/global.d.ts:
--------------------------------------------------------------------------------
1 | declare module '*.mp3'
2 | declare module '*.json'
3 | declare module '*.css'
4 | declare module '*.less'
5 | declare module '*.scss'
6 | declare module '*.sass'
7 | declare module '*.svg'
8 | declare module '*.png'
9 | declare module '*.jpg'
10 | declare module '*.jpeg'
11 | declare module '*.gif'
12 | declare module '*.bmp'
13 | declare module '*.tiff'
14 |
--------------------------------------------------------------------------------
/Example/src/index.ts:
--------------------------------------------------------------------------------
1 | import { AppRegistry } from 'react-native'
2 | import App from './App'
3 | import { name } from '../app.json'
4 |
5 | AppRegistry.registerComponent(name, () => App)
6 |
7 | // React Navigation 5.x
8 | // yarn add @react-navigation/native @react-navigation/stack
9 | // yarn add react-native-reanimated react-native-gesture-handler react-native-screens react-native-safe-area-context @react-native-community/masked-view
10 |
--------------------------------------------------------------------------------
/Example/src/types/index.ts:
--------------------------------------------------------------------------------
1 | export enum Views {
2 | Main = 'Main',
3 | Foo = 'Foo',
4 | Bar = 'Bar',
5 | }
6 |
7 | export type RootStackParamList = {
8 | [Views.Main]: undefined;
9 | [Views.Foo]: undefined;
10 | [Views.Bar]: { userId: string };
11 | }
12 |
--------------------------------------------------------------------------------
/Example/src/views/Bar/index.tsx:
--------------------------------------------------------------------------------
1 | import React, { FC } from 'react'
2 | import { StyleSheet, SafeAreaView, View, Text } from 'react-native'
3 | import type { StackNavigationProp } from '@react-navigation/stack'
4 | import type { RouteProp } from '@react-navigation/native'
5 | import { Views, RootStackParamList } from '../../types'
6 |
7 | type BarProps = {
8 | navigation: StackNavigationProp
9 | route: RouteProp
10 | }
11 |
12 | const Bar: FC = ({ route }) => {
13 | console.log(route.params.userId)
14 | return (
15 |
16 |
17 | Bar 页面
18 |
19 |
20 | )
21 | }
22 |
23 | const styles = StyleSheet.create({
24 | SafeAreaView: {
25 | flex: 1,
26 | borderWidth: 3,
27 | borderColor: 'red',
28 | },
29 | View: {
30 | flex: 1,
31 | justifyContent: 'center',
32 | alignItems: 'center',
33 | },
34 | Text: {
35 | color: 'red',
36 | fontSize: 40,
37 | },
38 | })
39 |
40 | export default Bar
41 |
--------------------------------------------------------------------------------
/Example/src/views/Foo/index.tsx:
--------------------------------------------------------------------------------
1 | import React, { FC } from 'react'
2 | import { StyleSheet, SafeAreaView, View, Text } from 'react-native'
3 | import type { StackNavigationProp } from '@react-navigation/stack'
4 | import type { RouteProp } from '@react-navigation/native'
5 | import { Views, RootStackParamList } from '../../types'
6 |
7 | type FooProps = {
8 | navigation: StackNavigationProp
9 | route: RouteProp
10 | }
11 |
12 | const Foo: FC = () => {
13 | return (
14 |
15 |
16 | Foo 页面
17 |
18 |
19 | )
20 | }
21 |
22 | const styles = StyleSheet.create({
23 | SafeAreaView: {
24 | flex: 1,
25 | borderWidth: 3,
26 | borderColor: 'blue',
27 | },
28 | View: {
29 | flex: 1,
30 | justifyContent: 'center',
31 | alignItems: 'center',
32 | },
33 | Text: {
34 | color: 'blue',
35 | fontSize: 40,
36 | },
37 | })
38 |
39 | export default Foo
40 |
--------------------------------------------------------------------------------
/Example/src/views/Main/index.tsx:
--------------------------------------------------------------------------------
1 | import React, { FC } from 'react'
2 | import { StyleSheet, ScrollView, View, Button } from 'react-native'
3 | import type { StackNavigationProp } from '@react-navigation/stack'
4 | import type { RouteProp } from '@react-navigation/native'
5 | import { Views, RootStackParamList } from '../../types'
6 |
7 | type MainProps = {
8 | navigation: StackNavigationProp
9 | route: RouteProp
10 | }
11 |
12 | const Main: FC = ({ navigation }) => {
13 | const handleFoo = () => navigation.navigate(Views.Foo)
14 |
15 | const handleBar = () => navigation.navigate(Views.Bar, { userId: '123' })
16 |
17 | return (
18 |
19 |
20 |
21 |
22 |
23 |
24 | )
25 | }
26 |
27 | const styles = StyleSheet.create({
28 | View: {
29 | flexDirection: 'row',
30 | justifyContent: 'space-evenly',
31 | alignItems: 'center',
32 | marginTop: 30,
33 | },
34 | })
35 |
36 | export default Main
37 |
--------------------------------------------------------------------------------
/Example/tsconfig.json:
--------------------------------------------------------------------------------
1 |
2 | {
3 | "compilerOptions": {
4 | /* Basic Options */
5 | "target": "esnext", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */
6 | "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
7 | "lib": ["es2017"], /* Specify library files to be included in the compilation. */
8 | "allowJs": true, /* Allow javascript files to be compiled. */
9 | // "checkJs": true, /* Report errors in .js files. */
10 | "jsx": "react-native", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
11 | // "declaration": true, /* Generates corresponding '.d.ts' file. */
12 | // "sourceMap": true, /* Generates corresponding '.map' file. */
13 | // "outFile": "./", /* Concatenate and emit output to single file. */
14 | // "outDir": "./", /* Redirect output structure to the directory. */
15 | // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
16 | // "removeComments": true, /* Do not emit comments to output. */
17 | "noEmit": true, /* Do not emit outputs. */
18 | // "incremental": true, /* Enable incremental compilation */
19 | // "importHelpers": true, /* Import emit helpers from 'tslib'. */
20 | // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
21 | "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
22 |
23 | /* Strict Type-Checking Options */
24 | "strict": true, /* Enable all strict type-checking options. */
25 | // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
26 | // "strictNullChecks": true, /* Enable strict null checks. */
27 | // "strictFunctionTypes": true, /* Enable strict checking of function types. */
28 | // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
29 | // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
30 | // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
31 |
32 | /* Additional Checks */
33 | // "noUnusedLocals": true, /* Report errors on unused locals. */
34 | // "noUnusedParameters": true, /* Report errors on unused parameters. */
35 | // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
36 | // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
37 |
38 | /* Module Resolution Options */
39 | "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
40 | // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
41 | // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
42 | // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
43 | // "typeRoots": [], /* List of folders to include type definitions from. */
44 | // "types": [], /* Type declaration files to be included in compilation. */
45 | "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
46 | "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
47 | // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
48 | "skipLibCheck": false /* Skip type checking of declaration files. */
49 |
50 | /* Source Map Options */
51 | // "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
52 | // "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */
53 | // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
54 | // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
55 |
56 | /* Experimental Options */
57 | // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
58 | // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
59 | },
60 | "exclude": [
61 | "node_modules", "babel.config.js", "metro.config.js", "jest.config.js"
62 | ]
63 | }
64 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # React-Native Code Splitting
2 |
3 | Further split the React Native code based on Metro build to improve performance, providing `Dll` and `Dynamic Imports` features
4 |
5 | ## Features & Solve issue
6 |
7 | - `Dll` **The split 820KB + common code (react、react-native) can be built into the App, similar to the Webpack DLLPlugin**
8 | - `Dynamic Imports` [**issue**](https://github.com/facebook/metro/issues/52)
9 |
10 | ## Compatibility with Metro versions
11 |
12 | - dependencies react-native -> @react-native-community/cli -> metro
13 | - metro-code-split -> metro
14 |
15 | | metro version | metro-code-split version |
16 | | :-----------: | :----------------------: |
17 | | 0.64.0 - 0.66.2 | 0.1.x |
18 |
19 | ## How to use it?
20 |
21 | 1. Install the package that matches the Metro version
22 |
23 | ```ts
24 | npm i metro-code-split -D | yarn add metro-code-split -D
25 | ```
26 |
27 | 2. Add the scripts in package.json
28 |
29 | ```ts
30 | "scripts": {
31 | "start": "mcs-scripts start -p 8081",
32 | "build:dllJson": "mcs-scripts build -t dllJson -od public/dll",
33 | "build:dll": "mcs-scripts build -t dll -od public/dll",
34 | "build": "mcs-scripts build -t busine -e index.js"
35 | }
36 | ```
37 |
38 | - More command details
39 |
40 | ```ts
41 | npx mcs-scripts --help
42 | ```
43 |
44 | 3. Modify the metro.config.js
45 |
46 | ```ts
47 | const Mcs = require('metro-code-split')
48 |
49 | const mcs = new Mcs({
50 | output: {
51 | publicPath: 'https://a.cdn.com/a-rn-project',
52 | },
53 | dll: {
54 | entry: ['react-native', 'react'], // which three - party library into dll
55 | referenceDir: './public/dll', // the JSON address to reference for the build DLL file, also the npm run build:dllJson output directory
56 | },
57 | dynamicImports: {}, // DynamicImports can also be set to false to disable this feature if it is not required
58 | })
59 |
60 | const busineConfig = {
61 | transformer: {
62 | getTransformOptions: async () => ({
63 | transform: {
64 | experimentalImportSupport: false,
65 | inlineRequires: true,
66 | },
67 | }),
68 | },
69 | }
70 |
71 | module.exports = process.env.NODE_ENV === 'production' ? mcs.mergeTo(busineConfig) : busineConfig
72 | ```
73 |
74 | - [Mcs DefaultOptions](./src/index.js)
75 |
76 | 4. Execute the command
77 |
78 | ```ts
79 | npm run build:dllJson // build the reference json file for the Dll
80 | npm run build:dll // build the Dll file (the generated Dll file is usually built into the APP)
81 | npm run build // build busine code
82 | ```
83 |
84 | ## Custom logic
85 |
86 | - Mcs options provides plugins. You can write plugins in the Mcs as if you were writing Webpack plugins
87 |
88 | | hooks | type | parameter |
89 | | :--------------------: | :----------: | :-------------------------------------------------: |
90 | | beforeInit | SyncHook | ['bundleOutputInfos'] |
91 | | beforeCheck | SyncHook | ['freezeFields'] |
92 | | afterCheck | SyncHook | ['freezeFields'] |
93 | | beforeCustomSerializer | SyncBailHook | ['entryPoint', 'prepend', 'graph', 'bundleOptions'] |
94 | | beforeOutputChunk | SyncHook | ['chunkInfo'] |
95 | | afterCustomSerializer | SyncHook | ['bundle'] |
96 |
97 | ## Attention to issue
98 |
99 | - This package is only used in `production` environments! (There are currently no plans to be compatible with `development`)
100 |
101 | - The add scripts are equivalent to The following (The main purpose is to optimize the `build:dllJson` `build:dll` long instructions, if you intend to provide commands using React-Native, be sure to add `NODE_ENV=xxx`)
102 | ```ts
103 | "scripts": {
104 | "start": "NODE_ENV=production react-native start --port 8081",
105 | "build:dllJson": "NODE_ENV=production react-native bundle --platform ios --entry-file node_modules/.cache/metro-code-split/dll-entry.js --bundle-output public/dll/_dll.ios.json --dev false & NODE_ENV=production react-native bundle --platform android --entry-file node_modules/.cache/metro-code-split/dll-entry.js --bundle-output public/dll/_dll.android.json --dev false",
106 | "build:dll": "NODE_ENV=production react-native bundle --platform ios --entry-file node_modules/.cache/metro-code-split/dll-entry.js --bundle-output public/dll/_dll.ios.bundle --dev false & NODE_ENV=production react-native bundle --platform android --entry-file node_modules/.cache/metro-code-split/dll-entry.js --bundle-output public/dll/_dll.android.bundle --dev false",
107 | "build": "NODE_ENV=production react-native bundle --platform ios --entry-file index.js --bundle-output dist/buz.ios.bundle --dev false & NODE_ENV=production react-native bundle --platform android --entry-file index.js --bundle-output dist/buz.android.bundle --dev false"
108 | }
109 | ```
110 |
111 | ## Rendering
112 |
113 |
114 |
115 |
116 |
117 | ## [Example](./Example/)
118 |
119 | ## TODO
120 |
121 | - source map support
122 | - ts refactor
123 |
--------------------------------------------------------------------------------
/license:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (C) 2005-present, 58.com. All rights reserved.
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "metro-code-split",
3 | "version": "0.1.7",
4 | "main": "src/index.js",
5 | "bin": {
6 | "mcs-scripts": "./src/bin/index.js"
7 | },
8 | "scripts": {
9 | "test": ""
10 | },
11 | "keywords": [
12 | "react-native",
13 | "metro",
14 | "code-split"
15 | ],
16 | "author": "qixiaoqi",
17 | "license": "MIT",
18 | "description": "Further split the React Native code based on Metro build to improve performance, providing `Dll` and `Dynamic Imports` features",
19 | "publishConfig": {
20 | "registry": "https://registry.npmjs.org"
21 | },
22 | "repository": {
23 | "type": "git",
24 | "url": "git+https://github.com/wuba/metro-code-split.git"
25 | },
26 | "dependencies": {
27 | "general-tools": "^0.0.4"
28 | },
29 | "peerDependencies": {
30 | "metro": ">=0.64.0"
31 | },
32 | "files": [
33 | "src"
34 | ]
35 | }
36 |
--------------------------------------------------------------------------------
/src/bin/build.js:
--------------------------------------------------------------------------------
1 | const path = require('path')
2 | const {
3 | fse,
4 | commander: { program },
5 | log,
6 | execa,
7 | getDEO,
8 | paths,
9 | setNodeEnv,
10 | } = require('general-tools')
11 | const { Commands, BuildType, commandName, Platform, NodeEnv, relativeDllEntry } = require('../types')
12 |
13 | const buildTypes = Object.values(BuildType)
14 | const platforms = Object.values(Platform)
15 |
16 | /**
17 | * CheckPlatforms
18 | * @param {string} str
19 | * @returns { string[] }
20 | */
21 | const handleCheckPlatforms = (str) => {
22 | const vs = str.split(',').map((v) => v.trim())
23 | for (const v of vs) {
24 | if (!platforms.includes(v)) {
25 | log(
26 | `error: parameter "${v}" is not in the range of "${platforms.join(', ')}"`,
27 | 'red'
28 | )
29 | process.exit(1)
30 | }
31 | }
32 | return vs
33 | }
34 |
35 | program
36 | .command(Commands.build)
37 | .description('build various types of packages')
38 | .option('-e, --entry ', 'build entry file path (for busine only)', 'index.js')
39 | .option('-od, --output-dir ', 'the output directory of the file', 'dist')
40 | .option(
41 | '-t, --type ',
42 | `build type (optional: ${buildTypes.join(' | ')})`,
43 | (value, dummyPrevious) => {
44 | if (!buildTypes.includes(value)) {
45 | log(
46 | `error: parameter "${value}" is not in the range of [${buildTypes.join(', ')}]`,
47 | 'red'
48 | )
49 | process.exit(1)
50 | }
51 | return value
52 | },
53 | BuildType.Busine
54 | )
55 | .option(
56 | '-p, --platforms ',
57 | `build platform (optional: ${platforms.join(', ')})`,
58 | platforms.join(', ')
59 | )
60 | .action(async ({ entry, type, platforms, outputDir }) => {
61 | setNodeEnv(NodeEnv.production)
62 |
63 | const pfs = handleCheckPlatforms(platforms)
64 |
65 | const isBuildDll = [BuildType.DllJson, BuildType.Dll].includes(type)
66 |
67 | await fse[isBuildDll ? 'ensureDir' : 'emptyDir'](path.resolve(paths.cwdDir, outputDir))
68 |
69 | for (const item of pfs) {
70 | const BuildTypeToFileNameMap = {
71 | [BuildType.DllJson]: `_dll.${item}.json`,
72 | [BuildType.Dll]: `_dll.${item}.bundle`,
73 | [BuildType.Busine]: `buz.${item}.bundle`,
74 | }
75 | await execa.command(
76 | [
77 | 'react-native bundle',
78 | `--platform ${item}`,
79 | `--entry-file ${isBuildDll ? relativeDllEntry : entry}`,
80 | `--bundle-output ${path.join(
81 | outputDir,
82 | BuildTypeToFileNameMap[type]
83 | )}`,
84 | '--dev false',
85 | ].join(' '),
86 | { ...getDEO(), stdio: 'inherit' }
87 | )
88 | }
89 |
90 | })
91 | .on('--help', () => {
92 | log(['\nExamples:', `npx ${commandName} ${Commands.build}`])
93 | })
94 |
--------------------------------------------------------------------------------
/src/bin/clear.js:
--------------------------------------------------------------------------------
1 | const path = require('path')
2 | const {
3 | execa,
4 | getDEO,
5 | fse,
6 | commander: { program },
7 | log,
8 | paths,
9 | clearConsole,
10 | } = require('general-tools')
11 | const { Commands, commandName } = require('../types')
12 |
13 | const handleClear = async () => {
14 | log('👉🏼 clear the cache ...')
15 | const npmCacheDir = path.resolve(paths.cwdDir, 'node_modules/.cache')
16 | await Promise.all([
17 | fse.emptyDir(npmCacheDir),
18 | execa.command(
19 | [
20 | 'npm cache clean --force',
21 | 'rm -rf $TMPDIR/metro-cache $TMPDIR/react-native-packager-cache-* haste-map-*',
22 | 'watchman watch-del-all',
23 | ].join(' && '), // && Just for elegant output
24 | { ...getDEO(), stdio: 'inherit' }
25 | ),
26 | ])
27 | clearConsole()
28 | log('✨ cache cleared!')
29 | }
30 |
31 | program
32 | .command(Commands.clear)
33 | .description('clear npm cache、metro cache、watchman')
34 | .action(handleClear)
35 | .on('--help', () => {
36 | log(['\nExamples:', `npx ${commandName} ${Commands.clear}`])
37 | })
38 |
39 | module.exports = handleClear
40 |
--------------------------------------------------------------------------------
/src/bin/index.js:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | const { commander: { program }, clearConsole } = require('general-tools')
4 | const { commandName } = require('../types')
5 | const pkg = require('../../package.json')
6 |
7 | clearConsole()
8 |
9 | program
10 | .name(commandName)
11 | .version(pkg.version, '-v, --version', 'output package version')
12 | .helpOption('-h, --help', 'display help')
13 |
14 | require('./clear')
15 |
16 | require('./update')
17 |
18 | require('./start')
19 |
20 | require('./build')
21 |
22 | program.parse(process.argv)
23 |
--------------------------------------------------------------------------------
/src/bin/start.js:
--------------------------------------------------------------------------------
1 | const {
2 | execa,
3 | commander: { program },
4 | log,
5 | getDEO,
6 | setNodeEnv,
7 | } = require('general-tools')
8 | const { Commands, commandName, NodeEnv } = require('../types')
9 |
10 | program
11 | .command(Commands.start)
12 | .description('start the local development server')
13 | .option('-p, --port ', 'server port', '8081')
14 | .action(async ({ port }) => {
15 | setNodeEnv(NodeEnv.development)
16 | log(`service will soon run on ${port}`)
17 | await execa.command(`react-native start --port ${port}`, {
18 | ...getDEO,
19 | stdio: 'inherit',
20 | })
21 | })
22 | .on('--help', () => {
23 | log(['\nExamples:', `npx ${commandName} ${Commands.start}`])
24 | })
25 |
--------------------------------------------------------------------------------
/src/bin/update.js:
--------------------------------------------------------------------------------
1 | const path = require('path')
2 | const {
3 | fse,
4 | execa,
5 | getDEO,
6 | commander: { program },
7 | log,
8 | paths,
9 | } = require('general-tools')
10 | const handleClear = require('./clear')
11 | const { Commands, commandName } = require('../types')
12 | const pkg = require('../../package.json')
13 |
14 | const hasNpmLock = () => fse.pathExists(path.resolve(paths.cwdDir, 'package-lock.json'))
15 | const hasYarnLock = () => fse.pathExists(path.resolve(paths.cwdDir, 'yarn.lock'))
16 |
17 | program
18 | .command(Commands.update)
19 | .description(`update ${pkg.name}`)
20 | .action(async () => {
21 | await handleClear()
22 | const [isNpmLock, isYarnLock] = await Promise.all([hasNpmLock(), hasYarnLock()])
23 | await execa.command(
24 | isYarnLock && !isNpmLock
25 | ? `yarn upgrade ${pkg.name}`
26 | : `npm update ${pkg.name}`,
27 | { ...getDEO(), stdio: 'inherit' }
28 | )
29 | })
30 | .on('--help', () => {
31 | log(['\nExamples:', `npx ${commandName} ${Commands.update}`])
32 | })
33 |
--------------------------------------------------------------------------------
/src/config/baseConfig.js:
--------------------------------------------------------------------------------
1 | // base default config
2 | const baseConfig = {
3 | resolver: {},
4 | transformer: {
5 | getTransformOptions: async () => ({
6 | transform: {
7 | experimentalImportSupport: true,
8 | inlineRequires: true,
9 | },
10 | }),
11 | },
12 | }
13 |
14 | module.exports = baseConfig
15 |
--------------------------------------------------------------------------------
/src/config/craeteMustConfig.js:
--------------------------------------------------------------------------------
1 | const path = require('path')
2 | const { fse } = require('general-tools')
3 | const dynamicImports = require('./dynamicImports')
4 | const { paths, replacePath, preName } = require('../utils')
5 |
6 | /**
7 | * craete must config
8 | * @param {import('../index.js')} mcs
9 | * @returns
10 | */
11 | module.exports = mcs => {
12 | return {
13 | // resetCache: true, // package body to build different projects
14 | // cacheStores: [], // concurrent build cache issues https://github.com/facebook/metro/issues/331
15 | transformer: mcs.hasDynamicImports ? { asyncRequireModulePath: paths.asyncRequireModulePath } : {},
16 | serializer: {
17 | // js with built-in App
18 | processModuleFilter: mcs.bundleOutputInfo.processModuleFilter,
19 | createModuleIdFactory: () => {
20 | const cacheMap = new Map()
21 | return absolutePath => {
22 | const moduleId = cacheMap.get(absolutePath)
23 | if (moduleId) return moduleId
24 | const relativePath = replacePath(absolutePath)
25 | if (mcs.isDllPath(absolutePath)) { // dll module
26 | const dllId = mcs.findDllModuleId(absolutePath)
27 | cacheMap.set(absolutePath, dllId)
28 | return dllId
29 | } else { // business module
30 | return mcs.options.createBusinessModuleId({ mcs, cacheMap, absolutePath, relativePath })
31 | }
32 | }
33 | },
34 | // Serializer
35 | async customSerializer (...args) {
36 | // build dllJosn pre section
37 | if (mcs.isBuildDllJson) {
38 | const preOutputPath = path.resolve(paths.outputDir, preName)
39 | const preContent = JSON.stringify(args[1].map(v => replacePath(v.path)), null, 2)
40 | await fse.writeFile(preOutputPath, preContent)
41 | }
42 | if (!mcs.isBuildDll) mcs.hooks.beforeCustomSerializer.call(...args)
43 |
44 | let bundle = ''
45 | if (mcs.hasDynamicImports && !mcs.isBuildDll) {
46 | bundle = await dynamicImports(mcs, ...args)
47 | } else {
48 | await fse.ensureDir(paths.outputDir)
49 | bundle = mcs.bundleToString(mcs.baseJSBundle(...args))
50 | }
51 |
52 | if (!mcs.isBuildDll) mcs.hooks.afterCustomSerializer.call(bundle)
53 |
54 | return bundle
55 | },
56 | },
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/src/config/dynamicImports.js:
--------------------------------------------------------------------------------
1 | const path = require('path')
2 | const { fse, getContentHash, babel: { parser, traverse, generate } } = require('general-tools')
3 | const { paths, output, replacePath } = require('../utils')
4 |
5 | const mainModuleId = 'main' // main moduleId flag
6 |
7 | /**
8 | * dynamicImports
9 | * @param {import('../index.js')} mcs
10 | * @param {*} entryPoint
11 | * @param {*} prepend
12 | * @param {*} graph
13 | * @param {*} bundleOptions
14 | * @returns
15 | */
16 | module.exports = async (mcs, entryPoint, prepend, graph, bundleOptions) => {
17 | const asyncFlag = mcs.options.dynamicImports.asyncFlag
18 | const minSize = mcs.options.dynamicImports.minSize
19 |
20 | const map = new Map([
21 | [
22 | mainModuleId, {
23 | moduleIds: new Set([]),
24 | modules: [],
25 | }
26 | ]
27 | ])
28 | const chunkModuleIdToHashMap = {} // record map info
29 | const outputChunkFns = [] // output chunk fns
30 |
31 | // finds if the parent ID is assigned to a chunk
32 | const findAllocationById = (fatheId) => {
33 | for (const [key, val] of map) {
34 | if (key === mainModuleId) continue
35 | if (val.moduleIds.has(fatheId)) return key
36 | }
37 | return null
38 | }
39 |
40 | // compute chunks
41 | for (const [key, value] of graph.dependencies) {
42 | // dll模块一定在主包中 不拆分 但是也必须走流程检测 否则异步引用dll模块 不会记录它的chunkModuleIdToHashMap
43 | const asyncTypes = [...value.inverseDependencies].map(absolutePath => {
44 | const relativePath = replacePath(absolutePath)
45 | const val = graph.dependencies.get(absolutePath)
46 | for (const [k, v] of val.dependencies) {
47 | if (v.absolutePath === key) {
48 | // 父级被拆分到某个chunk中 该模块同步引用
49 | const chunkModuleId = findAllocationById(relativePath)
50 | if (chunkModuleId && v.data.data.asyncType === null) return chunkModuleId
51 | return v.data.data.asyncType
52 | }
53 | }
54 | })
55 |
56 | // [] main
57 |
58 | // [null] main
59 | // [asyncFlag] only async add chunk
60 | // ['src/components/AsyncComA.tsx'] 异步模块中同步引用 从属与某个chunk
61 |
62 | // [null, asyncFlag] main
63 | // [asyncFlag, 'src/components/AsyncComA.tsx'] (理论应该拆分,本期拆到main中)
64 | // ['src/components/AsyncComA.tsx', 'src/components/AsyncComB.tsx'] 多个异步模块中同步引用相同的代码 (理论应该拆分,本期拆到main中)
65 | // [null, 'src/components/AsyncComA.tsx'] main
66 |
67 | // [null, asyncFlag, 'src/components/AsyncComA.tsx'] main
68 |
69 | const relativePath = replacePath(key)
70 | if (asyncTypes.length === 0 || asyncTypes.some(v => v === null)) { // 没有任何逆依赖 (如入口文件)
71 | map.get(mainModuleId).moduleIds.add(relativePath)
72 | } else if (asyncTypes.every(v => v === asyncFlag)) {
73 | map.set(relativePath, {
74 | moduleIds: new Set([relativePath]),
75 | modules: [],
76 | })
77 | } else if (asyncTypes.length === 1) {
78 | map.get(asyncTypes[0]).moduleIds.add(relativePath)
79 | } else {
80 | map.get(mainModuleId).moduleIds.add(relativePath)
81 | }
82 | }
83 |
84 | const { pre, post, modules } = mcs.baseJSBundle(entryPoint, prepend, graph, bundleOptions) // { pre, post, modules }
85 |
86 | const allocation = () => {
87 | for (const [key, val] of map) val.modules.length = 0 // clear modules
88 | for (const [moduleId, moduleCode] of modules) {
89 | for (const [key, val] of map) {
90 | if (val.moduleIds.has(moduleId)) {
91 | val.modules.push([moduleId, moduleCode])
92 | break
93 | }
94 | }
95 | }
96 | }
97 |
98 | // pre allocated
99 | allocation()
100 |
101 | for (const [key, val] of map) {
102 | if (key === mainModuleId) continue
103 | const totalByteLength = val.modules.reduce((b, [moduleId, moduleCode]) => b + Buffer.byteLength(moduleCode), 0)
104 | if (totalByteLength < minSize) { // non't break up
105 | const main = map.get(mainModuleId)
106 | main.moduleIds = new Set([...main.moduleIds, ...val.moduleIds])
107 | map.delete(key)
108 | }
109 | }
110 |
111 | // formal allocated
112 | allocation()
113 |
114 | map.size >= 2 && await fse.ensureDir(mcs.outputChunkDir)
115 | for (const [key, val] of map) {
116 | if (key === mainModuleId) continue
117 | const { code } = mcs.bundleToString({ pre: '', post: '', modules: val.modules })
118 | const hash = getContentHash(Buffer.from(code)).substr(0, mcs.options.output.chunkHashLength)
119 | if (chunkModuleIdToHashMap[key] === undefined) chunkModuleIdToHashMap[key] = {}
120 | chunkModuleIdToHashMap[key] = { ...chunkModuleIdToHashMap[key], hash }
121 | mcs.hooks.beforeOutputChunk.call({
122 | code,
123 | chunkModuleIdToHashMapVal: chunkModuleIdToHashMap[key],
124 | outputChunkFns,
125 | })
126 | outputChunkFns.push((async () => {
127 | const dir = path.resolve(mcs.outputChunkDir, `${hash}${output.fileSuffix}`)
128 | await fse.writeFile(dir, code)
129 | console.log(`info Writing chunk bundle output to: ${replacePath(dir)}`)
130 | })())
131 | }
132 | await Promise.all(outputChunkFns)
133 |
134 | // inject map info
135 | for (const arr of map.get(mainModuleId).modules) {
136 | if (arr[0] === replacePath(paths.chunkModuleIdToHashMapPath)) {
137 | const ast = parser.parse(arr[1])
138 | traverse(ast, {
139 | FunctionExpression(nodePath) {
140 | nodePath
141 | .get('body.body.0')
142 | .get('expression')
143 | .get('right')
144 | .replaceWithSourceString(JSON.stringify(chunkModuleIdToHashMap))
145 | }
146 | })
147 | const { code } = generate(ast, { minified: true })
148 | arr[1] = code
149 | break
150 | }
151 | }
152 |
153 | return mcs.bundleToString({ pre, post, modules: map.get(mainModuleId).modules })
154 | }
155 |
--------------------------------------------------------------------------------
/src/index.js:
--------------------------------------------------------------------------------
1 | const path = require('path')
2 | const { mergeConfig } = require('metro-config')
3 | const { fse, ejs, tapable: { SyncHook, SyncBailHook }, log, paths: ps, dataExtend, argv } = require('general-tools')
4 | const baseConfig = require('./config/baseConfig')
5 | const InjectVar = require('./plugins/InjectVar')
6 | const { isBaseDllPath, paths, dllJsonName, output, replacePath, preName } = require('./utils')
7 | const { BuildType } = require('./types')
8 | const pkg = require('../package.json')
9 |
10 | /**
11 | * @typedef {typeof defaultOptions} DefaultOptions
12 | */
13 | const defaultOptions = {
14 | output: {
15 | publicPath: '', // involving chunk prefix
16 | chunkDir: 'chunks', // chunk relative output dir
17 | chunkHashLength: 20, // chunk hash length
18 | chunkLoadTimeout: 120000, // chunk request timeout time
19 | },
20 | dll: {
21 | entry: [], // which three - party library into dll
22 | referenceDir: './dll', // the JSON address to reference for the build DLL file
23 | },
24 | dynamicImports: { // DynamicImports can also be set to false to disable this feature if it is not required
25 | asyncFlag: 'async', // async flag
26 | minSize: 20000, // minimum split size before compression
27 | },
28 | globalInlayVarName: '__APP__',
29 | // module path
30 | // /node_modules/metro/src/Server.js
31 | baseJSBundlePath: 'metro/src/DeltaBundler/Serializers/baseJSBundle',
32 | bundleToStringPath: 'metro/src/lib/bundleToString',
33 | asyncRequirePath: 'metro-runtime/src/modules/asyncRequire',
34 | // asyncRequire tpl address
35 | asyncRequireTpl: require.resolve('./tpl/wrapAsyncRequire.ejs'),
36 | asyncRequireTplExtraOptions: {},
37 | plugins: [],
38 | createBusinessModuleId ({ cacheMap, absolutePath, relativePath }) {
39 | cacheMap.set(absolutePath, relativePath)
40 | return relativePath
41 | }
42 | }
43 |
44 | class MetroCodeSplit {
45 | freezeFields = [
46 | 'serializer.processModuleFilter',
47 | 'serializer.createModuleIdFactory',
48 | 'serializer.customSerializer',
49 | ]
50 |
51 | // match functions according to the output
52 | bundleOutputInfos = [
53 | {
54 | // Output dll json manifest
55 | name: BuildType.DllJson,
56 | regexp: /_dll\.(ios|android)\.json/,
57 | processModuleFilter: (() => {
58 | const dllArr = []
59 | const busineArr = []
60 | let timeId = null
61 |
62 | return arg => {
63 | const relativePath = replacePath(arg.path)
64 | const arr = this.options.dll.entry.length !== 0 && isBaseDllPath(relativePath) ? dllArr : busineArr
65 | arr.push(relativePath)
66 |
67 | timeId && clearTimeout(timeId)
68 | timeId = setTimeout(async () => {
69 | try {
70 | const dllOutputPath = path.resolve(paths.outputDir, dllJsonName)
71 | const dllContent = JSON.stringify([...new Set(dllArr)], null, 2)
72 | await fse.writeFile(dllOutputPath, dllContent)
73 | console.log(`info Writing json output to: ${replacePath(dllOutputPath)}`)
74 | } catch (err) {
75 | console.error(err)
76 | }
77 | }, 1500)
78 |
79 | return true
80 | }
81 | })(),
82 | },
83 | {
84 | // Output dll package
85 | name: BuildType.Dll,
86 | regexp: /_dll\.(ios|android)/,
87 | processModuleFilter: arg => this.isDllPath(arg.path),
88 | },
89 | {
90 | // Output busine package
91 | name: BuildType.Busine,
92 | regexp: /buz\.(ios|android)\.bundle/,
93 | processModuleFilter: arg => !this.isDllPath(arg.path),
94 | },
95 | ]
96 |
97 | /**
98 | * @param {DefaultOptions} options
99 | */
100 | constructor (options = {}) {
101 | /** @type {DefaultOptions} */
102 | this.options = dataExtend(true, {}, defaultOptions, options)
103 | this.hooks = Object.freeze({
104 | /** @type {SyncHook<[any[]]>} */
105 | beforeInit: new SyncHook(['bundleOutputInfos']),
106 | /** @type {SyncHook<[string[]]>} */
107 | beforeCheck: new SyncHook(['freezeFields']),
108 | /** @type {SyncHook<[string[]]>} */
109 | afterCheck: new SyncHook(['freezeFields']),
110 | /** @type {SyncBailHook<[any, any, any, any]>} */
111 | beforeCustomSerializer: new SyncBailHook(['entryPoint', 'prepend', 'graph', 'bundleOptions']),
112 | /** @type {SyncHook<[object]>} */
113 | beforeOutputChunk: new SyncHook(['chunkInfo']),
114 | /** @type {SyncHook<[string]>} */
115 | afterCustomSerializer: new SyncHook(['bundle']),
116 | })
117 | this.registerPlugin()
118 | this.hooks.beforeInit.call(this.bundleOutputInfos)
119 | // singleton pattern
120 | this._init = this.init()
121 | }
122 |
123 | registerPlugin () {
124 | const plugins = this.options.plugins.slice()
125 | plugins.push(new InjectVar()) // First the external plugin in the built-in plugin
126 | for (const plugin of plugins) {
127 | plugin && plugin.register && plugin.register(this)
128 | }
129 | }
130 |
131 | async init () {
132 | await Promise.all([
133 | this.isBuildDll && this.createDllEntryTpl(),
134 | this.hasDynamicImports && this.createAsyncRequire()
135 | ])
136 | }
137 |
138 | async createDllEntryTpl () {
139 | let dllEntryContent = ''
140 | for (const [i, v] of Object.entries(this.options.dll.entry)) {
141 | dllEntryContent += `\nimport * as arg${i} from '${v}'\nconsole.log(arg${i})\n`
142 | }
143 | await fse.ensureFile(paths.dllEntryPath)
144 | await fse.writeFile(paths.dllEntryPath, dllEntryContent)
145 | }
146 |
147 | async createAsyncRequire () {
148 | const content = await ejs.renderFile(
149 | path.resolve(ps.cwdDir, this.options.asyncRequireTpl),
150 | {
151 | options: {
152 | packageName: pkg.name,
153 | asyncRequirePath: this.options.asyncRequirePath,
154 | globalInlayVarName: this.options.globalInlayVarName,
155 | relativeChunkDir: this.options.output.chunkDir,
156 | fileSuffix: output.fileSuffix,
157 | timeoutTime: (this.hasDynamicImports ? this.options : defaultOptions)['output']['chunkLoadTimeout'],
158 | ...this.options.asyncRequireTplExtraOptions,
159 | }
160 | }
161 | )
162 | await fse.ensureFile(paths.asyncRequireModulePath)
163 | await fse.writeFile(paths.asyncRequireModulePath, content)
164 | }
165 |
166 | check (busineConfig) {
167 | this.hasDynamicImports && this.freezeFields.push('transformer.asyncRequireModulePath')
168 | // check freezeFields
169 | for (const v of this.freezeFields) {
170 | const arr = v.split('.')
171 | let median = null
172 | for (let i = 0; i <= arr.length - 1; i++) {
173 | const key = arr[i]
174 | if (i === arr.length - 1 && median[key]) {
175 | log(
176 | `The merge conflict originates from field "${v}". Try to delete the conflicting fieldMerging Conflicts Origins!`,
177 | 'red'
178 | )
179 | process.exit(1)
180 | } else {
181 | if (typeof busineConfig[key] === 'object') {
182 | median = busineConfig[key]
183 | } else {
184 | break // there is no problem
185 | }
186 | }
187 | }
188 | }
189 | }
190 |
191 | /**
192 | * is dll resource path
193 | * @param { string } p absolute path
194 | * @returns { boolean }
195 | */
196 | isDllPath = p => {
197 | let prePaths = []
198 | let commonPaths = []
199 | const preRefPath = path.resolve(ps.cwdDir, path.join(this.options.dll.referenceDir, preName))
200 | const dllRefPath = path.resolve(ps.cwdDir, path.join(this.options.dll.referenceDir, dllJsonName))
201 | try {
202 | prePaths = require(preRefPath)
203 | } catch (err) {
204 | !this.isBuildDllJson && log('warning: failed to load the preRefPath correctly! are you setting the "dll.referenceDir" correctly?', 'yellow')
205 | }
206 | try {
207 | commonPaths = require(dllRefPath)
208 | } catch (err) {
209 | !this.isBuildDllJson && log('warning: failed to load the dllRefPath correctly! are you setting the "dll.referenceDir" correctly?', 'yellow')
210 | }
211 | // inertia method
212 | this.isDllPath = ap => {
213 | const rp = replacePath(ap)
214 | // iife section contains | __d ===
215 | return prePaths.some(v => rp.endsWith(v) || v.endsWith(rp)) || commonPaths.includes(rp)
216 | }
217 | return this.isDllPath(p)
218 | }
219 |
220 | /**
221 | * @param { string } p absolute path
222 | * @returns { string }
223 | */
224 | findDllModuleId = p => {
225 | let prePaths = []
226 | let commonPaths = []
227 | const preRefPath = path.resolve(ps.cwdDir, path.join(this.options.dll.referenceDir, preName))
228 | const dllRefPath = path.resolve(ps.cwdDir, path.join(this.options.dll.referenceDir, dllJsonName))
229 | try {
230 | prePaths = require(preRefPath)
231 | } catch (err) {
232 | !this.isBuildDllJson && log('warning: failed to load the preRefPath correctly! are you setting the "dll.referenceDir" correctly?', 'yellow')
233 | }
234 | try {
235 | commonPaths = require(dllRefPath)
236 | } catch (err) {
237 | !this.isBuildDllJson && log('warning: failed to load the dllRefPath correctly! are you setting the "dll.referenceDir" correctly?', 'yellow')
238 | }
239 | // inertia method
240 | this.findDllModuleId = ap => {
241 | const rp = replacePath(ap)
242 | const iifeId = prePaths.find(v => rp.endsWith(v) || v.endsWith(rp))
243 | if (iifeId) return iifeId
244 | const dId = commonPaths.find(v => v === rp)
245 | if (dId) return dId
246 | throw new Error('failed to find the dll module id!')
247 | }
248 | return this.findDllModuleId(p)
249 | }
250 |
251 | async mergeTo (busineConfig) {
252 | if (!require('./utils').isProduction) {
253 | log(
254 | `Package "${pkg.name}" should only be used in production environments!`,
255 | 'red'
256 | )
257 | process.exit(1)
258 | }
259 | await this._init
260 | this.hooks.beforeCheck.call(this.freezeFields)
261 | this.check(busineConfig)
262 | this.hooks.afterCheck.call(this.freezeFields)
263 | const craeteMustConfig = require('./config/craeteMustConfig')
264 | return mergeConfig(baseConfig, busineConfig, craeteMustConfig(this))
265 | }
266 |
267 | get baseJSBundle () { return require(this.options.baseJSBundlePath) }
268 |
269 | get bundleToString () { return require(this.options.bundleToStringPath) }
270 |
271 | get outputDir () { return paths.outputDir }
272 |
273 | get outputChunkDir () { return path.resolve(paths.outputDir, this.options.output.chunkDir) }
274 |
275 | get hasDynamicImports () { return !!this.options.dynamicImports }
276 |
277 | // Do not match the default required to play the business
278 | get bundleOutputInfo () {
279 | let bundleOutputInfo = this.bundleOutputInfos.find(({ regexp }) => regexp.test(argv['bundle-output']))
280 | bundleOutputInfo === undefined && (bundleOutputInfo = this.bundleOutputInfos.find(({ name }) => name === BuildType.Busine))
281 | return bundleOutputInfo
282 | }
283 |
284 | // Whether or not to build Dll is relevant
285 | get isBuildDll () {
286 | return [BuildType.DllJson, BuildType.Dll].includes(this.bundleOutputInfo.name)
287 | }
288 |
289 | get isBuildDllJson () {
290 | return BuildType.DllJson === this.bundleOutputInfo.name
291 | }
292 | }
293 |
294 | module.exports = MetroCodeSplit
295 |
--------------------------------------------------------------------------------
/src/plugins/InjectVar.js:
--------------------------------------------------------------------------------
1 | const { babel: { t, template, generate } } = require('general-tools')
2 |
3 | class InjectVar {
4 | register (mcs) {
5 | mcs.hooks.beforeCustomSerializer.tap('InjectVar', (entryPoint, prepend, graph, bundleOptions) => {
6 | for (const [key, value] of graph.dependencies) {
7 | // to entry file injection of global variables __APP__
8 | if (entryPoint === key) {
9 | for (const { data } of value.output) {
10 | const ast = template(`var %%globalInlayVarName%% = { publicPath: %%publicPath%% }`)({
11 | globalInlayVarName: mcs.options.globalInlayVarName,
12 | publicPath: t.stringLiteral(mcs.options.output.publicPath)
13 | })
14 |
15 | const { code } = generate(ast, { minified: true })
16 | data.code = code + '\n' + data.code
17 | }
18 | break
19 | }
20 | }
21 | })
22 | }
23 | }
24 |
25 | module.exports = InjectVar
26 |
--------------------------------------------------------------------------------
/src/tpl/chunkModuleIdToHashMap.js:
--------------------------------------------------------------------------------
1 | // runtime population
2 | module.exports = {
3 | // Example:
4 | // 'src/components/AsyncComA.tsx': {
5 | // hash: '9a9785090352e99eddc199d04a50a97f',
6 | // encryptHash: 'bde707689328dda1c3e87893537426b7',
7 | // },
8 | // 'src/components/Cycle1.tsx': {
9 | // hash: '52f4df49a2139b4e821c9bb2e7cc2c9c',
10 | // encryptHash: '5676b468b84d530456909cc68126f970',
11 | // },
12 | // 'src/components/Cycle2.tsx': {
13 | // hash: '6f2a15301547a5263a12959c89695c4e',
14 | // encryptHash: '666954a1d03682b6277ec3564bca1e89',
15 | // },
16 | // Temporary does not support
17 | // 'B': ['_B', '_C'], // Promise.all([__webpack_require__.e(0), __webpack_require__.e(2)])
18 | }
19 |
--------------------------------------------------------------------------------
/src/tpl/wrapAsyncRequire.ejs:
--------------------------------------------------------------------------------
1 | const asyncRequire = require('<%= options.asyncRequirePath %>')
2 | // runtime as small as possible
3 | const urlJoin = require('general-tools/src/url-join')
4 | const chunkModuleIdToHashMap = require('<%= options.packageName %>/src/tpl/chunkModuleIdToHashMap')
5 |
6 | /**
7 | * load additional a single chunk
8 | * @param { string } chunkId
9 | * @returns
10 | */
11 | const requireEnsure = (chunkId) => {
12 | // stores loaded and loading chunk
13 | // undefined = chunk not loaded, null = chunk preloaded/prefetched
14 | // [resolve, reject, promise] = chunk loading, 0 = chunk loaded
15 | const installedChunks = global.installedChunks = global.installedChunks || {
16 | // 'buz.ios.bundle': 0 // [chunkId]: [state]
17 | }
18 | const promises = []
19 | let installedChunkData = installedChunks[chunkId]
20 | if (installedChunkData !== 0) { // chunkId load is not complete
21 | if (installedChunkData) { // [] loading
22 | promises.push(installedChunkData[2])
23 | } else { // undefined not loaded
24 | const promise = new Promise(function(resolve, reject) {
25 | installedChunkData = installedChunks[chunkId] = [resolve, reject]
26 | })
27 | promises.push(installedChunkData[2] = promise)
28 | const error = new Error() // create errors before stack expansion so that useful stack traces can be obtained later
29 | const resourceUri = urlJoin(
30 | global.<%= options.globalInlayVarName %>.publicPath,
31 | '<%= options.relativeChunkDir %>',
32 | chunkModuleIdToHashMap[chunkId]['hash'] + '<%= options.fileSuffix %>'
33 | )
34 | let timeoutId
35 | const onComplete = ({ code, data, msg }) => { // fetch success or failure | js timeout
36 | clearTimeout(timeoutId)
37 | const state = installedChunks[chunkId]
38 | if (state === undefined) return // js timeout but fetch give the results
39 | const [resolve, reject] = state
40 | if (code !== 200) { // failure
41 | error.message = msg
42 | error.type = error.name = 'ChunkLoadError'
43 | error.request = resourceUri
44 | installedChunks[chunkId] = undefined
45 | return reject(error)
46 | }
47 | // successful
48 | // compared eval(data) Faster and safer https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval
49 | Function(`"use strict"; ${data}`)()
50 | installedChunks[chunkId] = 0
51 | resolve()
52 | }
53 | // timeout handling
54 | const timeoutTime = <%= options.timeoutTime %>
55 | timeoutId = setTimeout(
56 | onComplete.bind(null, {
57 | code: 0,
58 | msg: `load chunk:${chunkId} failure(timeout:${timeoutTime})`
59 | }),
60 | timeoutTime
61 | )
62 |
63 | fetch(resourceUri).then(res => {
64 | if (res.status === 200) {
65 | res.text().then(res => {
66 | onComplete({ code: 200, data: res })
67 | }).catch(err => {
68 | onComplete({ code: 0, msg: err.message })
69 | })
70 | } else {
71 | onComplete({ code: res.status, msg: res.statusText })
72 | }
73 | }).catch(err => {
74 | onComplete({ code: 0, msg: err.message })
75 | })
76 |
77 | }
78 | }
79 | return Promise.all(promises)
80 | }
81 |
82 | const wrapAsyncRequire = async moduleId => {
83 | const hashMap = chunkModuleIdToHashMap[moduleId]
84 | if (!hashMap) { // a module is knocked down into the main package, But there are places for asynchrony
85 | await Promise.resolve()
86 | } else if (Array.isArray(hashMap)) { // TODO the reserved
87 | await Promise.all(hashMap.map(v => requireEnsure(v)))
88 | } else {
89 | await requireEnsure(moduleId)
90 | }
91 | return asyncRequire(moduleId)
92 | }
93 |
94 | module.exports = wrapAsyncRequire
95 |
--------------------------------------------------------------------------------
/src/types/BuildType.js:
--------------------------------------------------------------------------------
1 | /**
2 | * build type
3 | */
4 | const BuildType = {
5 | DllJson: 'dllJson',
6 | Dll: 'dll',
7 | Busine: 'busine',
8 | }
9 |
10 | module.exports = BuildType
11 |
--------------------------------------------------------------------------------
/src/types/Commands.js:
--------------------------------------------------------------------------------
1 | /**
2 | * command enume
3 | */
4 | const Commands = {
5 | clear: 'clear',
6 | update: 'update',
7 | start: 'start',
8 | build: 'build',
9 | }
10 |
11 | module.exports = Commands
12 |
--------------------------------------------------------------------------------
/src/types/NodeEnv.js:
--------------------------------------------------------------------------------
1 | const NodeEnv = {
2 | development: 'development',
3 | production: 'production',
4 | }
5 |
6 | module.exports = NodeEnv
7 |
--------------------------------------------------------------------------------
/src/types/Platform.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 构建平台
3 | */
4 | const Platform = {
5 | ios: 'ios',
6 | android: 'android',
7 | }
8 |
9 | module.exports = Platform
10 |
--------------------------------------------------------------------------------
/src/types/index.js:
--------------------------------------------------------------------------------
1 | const Platform = require('./Platform')
2 | const relativeDllEntry = require('./relativeDllEntry')
3 | const NodeEnv = require('./NodeEnv')
4 | const Commands = require('./Commands')
5 | const BuildType = require('./BuildType')
6 | const pkg = require('../../package.json')
7 |
8 | module.exports = {
9 | Platform,
10 | relativeDllEntry,
11 | NodeEnv,
12 | commandName: Object.keys(pkg.bin)[0],
13 | Commands,
14 | BuildType,
15 | }
16 |
--------------------------------------------------------------------------------
/src/types/relativeDllEntry.js:
--------------------------------------------------------------------------------
1 | const pkg = require('../../package.json')
2 |
3 | const relativeDllEntry = `node_modules/.cache/${pkg.name}/dll-entry.js`
4 |
5 | module.exports = relativeDllEntry
6 |
--------------------------------------------------------------------------------
/src/utils/index.js:
--------------------------------------------------------------------------------
1 | const { argv } = require('general-tools')
2 | const paths = require('./paths')
3 | const isProduction = require('./isProduction')
4 | const output = require('./output')
5 | const replacePath = require('./replacePath')
6 | const { relativeDllEntry } = require('../types')
7 |
8 | /**
9 | * 是否是基础 dll资源路径
10 | * @param { string } p
11 | */
12 | const isBaseDllPath = (p) =>
13 | ['__prelude__', 'node_modules', 'require-node_modules'].some((v) =>
14 | p.includes(v)
15 | ) && ![relativeDllEntry, `require-${relativeDllEntry}`].some((v) => p.includes(v))
16 |
17 | module.exports = {
18 | paths,
19 | isProduction,
20 | output,
21 | replacePath,
22 | dllJsonName: `_dll.${argv.platform}.json`,
23 | preName: `_pre.${argv.platform}.json`,
24 | isBaseDllPath,
25 | }
26 |
--------------------------------------------------------------------------------
/src/utils/isProduction.js:
--------------------------------------------------------------------------------
1 | const { argv } = require('general-tools')
2 |
3 | // 该项目的配置仅用于热更新平台(生产环境)
4 | // 本地开发 通常执行 react-native start 不会有 platform 及 bundle-output
5 | const isProduction = argv._.includes('bundle') && ['ios', 'android'].includes(argv.platform)
6 |
7 | module.exports = isProduction
8 |
--------------------------------------------------------------------------------
/src/utils/output.js:
--------------------------------------------------------------------------------
1 | const path = require('path')
2 | const { argv } = require('general-tools')
3 |
4 | const { dir, ext } = path.parse(argv['bundle-output'] || '')
5 |
6 | module.exports = {
7 | relativeDir: dir,
8 | fileSuffix: ext,
9 | }
10 |
--------------------------------------------------------------------------------
/src/utils/paths/asyncRequireModulePath.js:
--------------------------------------------------------------------------------
1 | const path = require('path')
2 | const { paths } = require('general-tools')
3 | const { name } = require('../../../package.json')
4 |
5 | const asyncRequireModulePath = path.resolve(paths.cwdDir, `node_modules/.cache/${name}/asyncRequire.js`)
6 |
7 | module.exports = asyncRequireModulePath
8 |
--------------------------------------------------------------------------------
/src/utils/paths/chunkModuleIdToHashMapPath.js:
--------------------------------------------------------------------------------
1 | /**
2 | * chunk moduleId to hash 模块路径
3 | */
4 | const chunkModuleIdToHashMapPath = require.resolve('../../tpl/chunkModuleIdToHashMap.js')
5 |
6 | module.exports = chunkModuleIdToHashMapPath
7 |
--------------------------------------------------------------------------------
/src/utils/paths/dllEntryPath.js:
--------------------------------------------------------------------------------
1 | const path = require('path')
2 | const { paths } = require('general-tools')
3 | const { relativeDllEntry } = require('../../types')
4 |
5 | const dllEntryPath = path.resolve(paths.cwdDir, relativeDllEntry)
6 |
7 | module.exports = dllEntryPath
8 |
--------------------------------------------------------------------------------
/src/utils/paths/index.js:
--------------------------------------------------------------------------------
1 | const path = require('path')
2 | const { paths } = require('general-tools')
3 | const output = require('../output')
4 |
5 | const outputDir = path.resolve(paths.cwdDir, output.relativeDir)
6 |
7 | module.exports = {
8 | outputDir,
9 | asyncRequireModulePath: require('./asyncRequireModulePath'),
10 | chunkModuleIdToHashMapPath: require('./chunkModuleIdToHashMapPath'),
11 | dllEntryPath: require('./dllEntryPath'),
12 | }
13 |
--------------------------------------------------------------------------------
/src/utils/replacePath.js:
--------------------------------------------------------------------------------
1 | const { paths } = require('general-tools')
2 |
3 | /**
4 | * converts absolute paths to relative paths
5 | * @param { string } to
6 | * @param { string } from
7 | * @returns
8 | * @describe Since some paths contain require-xxx, so use replace instead of path.relative
9 | */
10 | const replacePath = (to, from = paths.cwdDir) => to.replace(from + '/', '')
11 |
12 | module.exports = replacePath
13 |
--------------------------------------------------------------------------------
/test/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wuba/metro-code-split/933a70acbf2b6a8d694bbcdcdd5a24c9bb14cc99/test/.gitkeep
--------------------------------------------------------------------------------