Skip to content
This repository was archived by the owner on Jan 9, 2021. It is now read-only.

Commit d9f4f5a

Browse files
authored
Merge pull request #22 from indirectlylit/hot
enable hot module reloading, clarify dist file types, bump version
2 parents 05932ad + 2765520 commit d9f4f5a

File tree

11 files changed

+26
-14
lines changed

11 files changed

+26
-14
lines changed

dist/vue-intl.js renamed to dist/vue-intl.dev.js

Lines changed: 11 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/vue-intl.dev.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/vue-intl.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

dist/vue-intl.min.js

Lines changed: 0 additions & 2 deletions
This file was deleted.

dist/vue-intl.min.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

dist/vue-intl.prod.min.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/vue-intl.prod.min.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "vue-intl",
3-
"version": "2.1.1",
3+
"version": "3.0.0",
44
"description": "Vue Plugin for FormatJS Internalization and Localization",
5-
"main": "dist/vue-intl.js",
5+
"main": "dist/vue-intl.dev.js",
66
"directories": {
77
"lib": "./dist"
88
},

rollup.config.dist.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ const isProduction = process.env.NODE_ENV === 'production';
5353
export default {
5454
input: p.resolve('src/vue-intl.js'),
5555
output: {
56-
file: p.resolve(`dist/vue-intl.${isProduction ? 'min.js' : 'js'}`),
56+
file: p.resolve(`dist/vue-intl.${isProduction ? 'prod.min.js' : 'dev.js'}`),
5757
format: 'umd',
5858
},
5959
name: 'VueIntl',
@@ -75,4 +75,4 @@ export default {
7575
warnings: false,
7676
}),
7777
].filter(Boolean),
78-
};
78+
};

src/format.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,12 @@ export function formatMessage(config, state, messageDescriptor = {}, values = {}
232232
return message || defaultMessage || id;
233233
}
234234

235+
// When debugging in English, show default string to enable hot module reloading
236+
if (process.env.NODE_ENV === 'development' && defaultMessage && locale === 'en') {
237+
var formatter = state.getMessageFormat(defaultMessage, locale, formats);
238+
return formatter.format(values);
239+
}
240+
235241
let formattedMessage;
236242

237243
if (message) {

0 commit comments

Comments
 (0)