diff --git a/packages/umi-plugin-locale/package.json b/packages/umi-plugin-locale/package.json index c554cbdc6b57..8316525f17f6 100644 --- a/packages/umi-plugin-locale/package.json +++ b/packages/umi-plugin-locale/package.json @@ -24,6 +24,7 @@ "umi" ], "dependencies": { + "intl": "^1.2.5", "moment": "2.x", "mustache": "^2.3.0", "prop-types": "^15.6.2", diff --git a/packages/umi-plugin-locale/src/index.js b/packages/umi-plugin-locale/src/index.js index 0647ab7c6ff4..79a94cdf2672 100644 --- a/packages/umi-plugin-locale/src/index.js +++ b/packages/umi-plugin-locale/src/index.js @@ -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'),