Update Webpack / Babel config

* Added module path in package.json
* Marked as having no side-effects
* Disable commonjs on build
This commit is contained in:
Evan Bacon
2019-03-09 01:17:47 -08:00
parent 12f719f50b
commit 7769428269
4 changed files with 9 additions and 3 deletions

View File

@@ -7,7 +7,11 @@ module.exports = {
],
plugins: [
'@babel/transform-block-scoping',
'@babel/transform-modules-commonjs',
// NOTE(brent): Intentionally leave ES6 imports alone, they supported and
// recommended by Webpack
// (https://webpack.js.org/api/module-methods/#es6-recommended) and of
// course metro
// '@babel/transform-modules-commonjs',
'@babel/proposal-class-properties',
'@babel/proposal-object-rest-spread',
],

View File

@@ -4,6 +4,8 @@
"description": "Core utilities for the react-navigation framework",
"main": "dist/index.js",
"react-native": "dist/index.js",
"module": "dist/index.js",
"sideEffects": false,
"files": [
"dist/",
"src/",

View File

@@ -2,7 +2,7 @@ let uniqueBaseId: string = `id-${Date.now()}`;
let uuidCount: number = 0;
export function _TESTING_ONLY_normalize_keys(): void {
uniqueBaseId = 'id';
uniqueBaseId = `id`;
uuidCount = 0;
}

View File

@@ -1,3 +1,3 @@
export default function docsUrl(path) {
export default function docsUrl(path: string) {
return `https://reactnavigation.org/docs/${path}`;
}