Skip to content

Commit

Permalink
chore: minor corrections with exports
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergio Moreno committed May 18, 2021
1 parent 2d25f2c commit 88c006b
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/cli/src/api/extractors/babel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { BabelOptions, ExtractorType } from "."
import { projectType } from "../detect"

const babelRe = new RegExp(
"\\.(" + DEFAULT_EXTENSIONS.map(ext => ext.slice(1)).join("|") + ")$",
"\\.(" + [...DEFAULT_EXTENSIONS, ".ts", ".tsx"].map(ext => ext.slice(1)).join("|") + ")$",
"i"
)

Expand Down
18 changes: 17 additions & 1 deletion packages/detect-locale/npm/esm/index.js
Original file line number Diff line number Diff line change
@@ -1 +1,17 @@
export * from './detect-locale.esm'
import {
detectDev, fromCookieDev, fromHtmlTagDev, fromNavigatorDev, fromPathDev, fromStorageDev, fromSubdomainDev, fromUrlDev, multipleDetectDev
} from "./detect-locale.development.js"

import {
detect, fromCookie, fromHtmlTag, fromNavigator, fromPath, fromStorage, fromSubdomain, fromUrl, multipleDetect
} from "./detect-locale.production.min.js"

export const detect = process.env.NODE_ENV === "production" ? detect : detectDev;
export const fromCookie = process.env.NODE_ENV === "production" ? fromCookie : fromCookieDev;
export const fromHtmlTag = process.env.NODE_ENV === "production" ? fromHtmlTag : fromHtmlTagDev;
export const fromNavigator = process.env.NODE_ENV === "production" ? fromNavigator : fromNavigatorDev;
export const fromPath = process.env.NODE_ENV === "production" ? fromPath : fromPathDev;
export const fromStorage = process.env.NODE_ENV === "production" ? fromStorage : fromStorageDev;
export const fromSubdomain = process.env.NODE_ENV === "production" ? fromSubdomain : fromSubdomainDev;
export const fromUrl = process.env.NODE_ENV === "production" ? fromUrl : fromUrlDev;
export const multipleDetect = process.env.NODE_ENV === "production" ? multipleDetect : multipleDetectDev;
13 changes: 12 additions & 1 deletion packages/react/npm/esm/index.js
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
export * from './react.esm'
import {
I18nProvider as devI18nProvider, Trans as devTrans, useLingui as devuseLingui, withI18n as devwithI18n
} from "./react.development.js"

import {
I18nProvider, Trans, useLingui, withI18n
} from "./react.production.min.js"

export const I18nProvider = process.env.NODE_ENV === "production" ? I18nProvider : devI18nProvider;
export const Trans = process.env.NODE_ENV === "production" ? Trans : devTrans;
export const useLingui = process.env.NODE_ENV === "production" ? useLingui : devuseLingui;
export const withI18n = process.env.NODE_ENV === "production" ? withI18n : devwithI18n;

1 comment on commit 88c006b

@vercel
Copy link

@vercel vercel bot commented on 88c006b May 18, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.