Skip to content

Commit

Permalink
Add support to ES module import
Browse files Browse the repository at this point in the history
  • Loading branch information
sveyret committed Mar 12, 2020
1 parent 63a7464 commit 1a00bcb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
"description": "Internationalization library for TypeScript",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"type": "commonjs",
"exports": {
"require": "./dist/index.js",
"import": "./dist/module.mjs"
},
"files": [
"dist/**",
"!dist/**/*.spec.*",
Expand All @@ -20,7 +25,7 @@
"test:dep": "depcheck",
"test:unit": "nyc mocha 'src/**/*.spec.ts'",
"build": "pm-exec run build:main",
"build:main": "tsc && copyfiles -u 1 src/**/*.js dist",
"build:main": "tsc && copyfiles -u 1 src/**/*.{m,c,}js dist",
"clean": "rimraf dist",
"example": "pm-exec run example:mobx-full && pm-exec run example:redux-lite",
"example:mobx-full": "cross-env NAME=mobx-full pm-exec run :example:name",
Expand Down
6 changes: 6 additions & 0 deletions src/module.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import intlts from './index'

export const createMessages = intlts.createMessages
export const LanguageMap = intlts.LanguageMap
const IntlTs = intlts.default
export default IntlTs

0 comments on commit 1a00bcb

Please sign in to comment.