Skip to content

Added react native build target #2947

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions packages-exp/auth-compat-exp/index.rn.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* @license
* Copyright 2017 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/**
* This is the file that people using React Native will actually import. You
* should only include this file if you have something specific about your
* implementation that mandates having a separate entrypoint. Otherwise you can
* just use index.ts
*/

import { testFxn } from './src';

testFxn();
1 change: 1 addition & 0 deletions packages-exp/auth-compat-exp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"browser": "dist/index.cjs.js",
"module": "dist/index.esm.js",
"esm2017": "dist/index.esm2017.js",
"react-native": "dist/index.rn.cjs.js",
"files": [
"dist"
],
Expand Down
11 changes: 10 additions & 1 deletion packages-exp/auth-compat-exp/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,16 @@ const es5Builds = [
output: [{ file: pkg.main, format: 'cjs', sourcemap: true }],
plugins: es5BuildPlugins,
external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`))
}
},
/**
* App React Native Builds
*/
{
input: 'index.rn.ts',
output: [{ file: pkg['react-native'], format: 'cjs', sourcemap: true }],
plugins: es5BuildPlugins,
external: id => [...deps, 'react-native'].some(dep => id === dep || id.startsWith(`${dep}/`))
},
];

/**
Expand Down