Skip to content

Commit a4e74fd

Browse files
authored
Added react native build target (#2947)
1 parent fc45b6c commit a4e74fd

File tree

3 files changed

+38
-1
lines changed

3 files changed

+38
-1
lines changed
+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/**
2+
* @license
3+
* Copyright 2017 Google LLC
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
/**
19+
* This is the file that people using React Native will actually import. You
20+
* should only include this file if you have something specific about your
21+
* implementation that mandates having a separate entrypoint. Otherwise you can
22+
* just use index.ts
23+
*/
24+
25+
import { testFxn } from './src';
26+
27+
testFxn();

packages-exp/auth-compat-exp/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"browser": "dist/index.cjs.js",
99
"module": "dist/index.esm.js",
1010
"esm2017": "dist/index.esm2017.js",
11+
"react-native": "dist/index.rn.cjs.js",
1112
"files": [
1213
"dist"
1314
],

packages-exp/auth-compat-exp/rollup.config.js

+10-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,16 @@ const es5Builds = [
5353
output: [{ file: pkg.main, format: 'cjs', sourcemap: true }],
5454
plugins: es5BuildPlugins,
5555
external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`))
56-
}
56+
},
57+
/**
58+
* App React Native Builds
59+
*/
60+
{
61+
input: 'index.rn.ts',
62+
output: [{ file: pkg['react-native'], format: 'cjs', sourcemap: true }],
63+
plugins: es5BuildPlugins,
64+
external: id => [...deps, 'react-native'].some(dep => id === dep || id.startsWith(`${dep}/`))
65+
},
5766
];
5867

5968
/**

0 commit comments

Comments
 (0)