Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
1,369 additions
and
5,373 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,3 +52,5 @@ buck-out/ | |
fastlane/report.xml | ||
fastlane/Preview.html | ||
fastlane/screenshots | ||
|
||
lib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
language: node_js | ||
node_js: | ||
- "11" | ||
- 'stable' | ||
after_script: | ||
- cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
module.exports = { | ||
presets: ['module:metro-react-native-babel-preset'], | ||
module.exports = (api) => { | ||
const preset = api.env('test') | ||
? 'module:metro-react-native-babel-preset' | ||
: ['@babel/preset-env', { modules: false }]; | ||
|
||
return { | ||
presets: ['@babel/preset-react', preset], | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/* eslint-disable import/no-unresolved */ | ||
/* eslint-disable global-require */ | ||
if (process.env.NODE_ENV === 'production') { | ||
module.exports = require('./lib/prod'); | ||
} else { | ||
module.exports = require('./lib/dev'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import babel from 'rollup-plugin-babel'; | ||
import commonjs from 'rollup-plugin-commonjs'; | ||
import resolve from 'rollup-plugin-node-resolve'; | ||
import replace from 'rollup-plugin-replace'; | ||
|
||
const NODE_ENV = process.env.NODE_ENV || 'development'; | ||
const outputFile = NODE_ENV === 'production' ? './lib/prod.js' : './lib/dev.js'; | ||
|
||
export default { | ||
input: './src/index.js', | ||
output: { | ||
file: outputFile, | ||
format: 'cjs', | ||
}, | ||
plugins: [ | ||
replace({ | ||
'process.env.NODE_ENV': JSON.stringify(NODE_ENV), | ||
}), | ||
babel({ | ||
exclude: 'node_modules/**', | ||
babelrc: false, | ||
presets: [['@babel/preset-env', { modules: false }], '@babel/preset-react'], | ||
}), | ||
resolve(), | ||
commonjs(), | ||
], | ||
external: id => /^react/.test(id), | ||
}; |
Oops, something went wrong.