Skip to content

Commit

Permalink
add intl (#1242)
Browse files Browse the repository at this point in the history
* add intl
Close: #1151

* fix targets

* remove prod
  • Loading branch information
xiaohuoni authored and sorrycc committed Oct 14, 2018
1 parent 8f52754 commit fc8e7e7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/umi-plugin-locale/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"umi"
],
"dependencies": {
"intl": "^1.2.5",
"moment": "2.x",
"mustache": "^2.3.0",
"prop-types": "^15.6.2",
Expand Down
7 changes: 7 additions & 0 deletions packages/umi-plugin-locale/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ export function getLocaleFileList(absSrcPath, singular) {

export default function(api, options = {}) {
const { config, paths } = api;
const { targets: { ie } = {} } = config;

if (ie && ie <= 10) {
api.addEntryPolyfillImports({
source: 'intl',
});
}

api.addPageWatcher(
join(paths.absSrcPath, config.singular ? 'locale' : 'locales'),
Expand Down

0 comments on commit fc8e7e7

Please sign in to comment.