File tree Expand file tree Collapse file tree 6 files changed +33
-14
lines changed Expand file tree Collapse file tree 6 files changed +33
-14
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ module.exports = function (grunt) {
54
54
options : {
55
55
prelude : [
56
56
'// GENERATED FILE' ,
57
- 'var DustIntl = require("./helpers ");\n\n'
57
+ 'var DustIntl = require("./dust-intl ");\n\n'
58
58
] . join ( '\n' ) ,
59
59
60
60
wrapEntry : function ( entry ) {
Original file line number Diff line number Diff line change 1
1
/* jshint node:true */
2
2
'use strict' ;
3
3
4
- // Add all locale data to `DustIntl`.
4
+ // Add all locale data to `DustIntl`. This module will be ignored when bundling
5
+ // for the browser with Browserify/Webpack.
5
6
require ( './lib/locales' ) ;
6
7
7
- exports = module . exports = require ( './lib/helpers ' ) ;
8
+ exports = module . exports = require ( './lib/dust-intl ' ) ;
Original file line number Diff line number Diff line change 23
23
},
24
24
"main" : " index.js" ,
25
25
"jsnext:main" : " src/main.js" ,
26
+ "browser" : {
27
+ "./lib/locales" : false ,
28
+ "./lib/locales.js" : false
29
+ },
26
30
"engines" : {
27
31
"node" : " >=0.10.0" ,
28
32
"npm" : " >=1.4.0"
Original file line number Diff line number Diff line change
1
+ /*
2
+ Copyright (c) 2014, Yahoo! Inc. All rights reserved.
3
+ Copyrights licensed under the New BSD License.
4
+ See the accompanying LICENSE file for terms.
5
+ */
6
+
7
+ /* jshint esnext: true */
8
+
9
+ import IntlMessageFormat from 'intl-messageformat' ;
10
+ import IntlRelativeFormat from 'intl-relativeformat' ;
11
+
12
+ import { registerWith } from './helpers.js' ;
13
+ import defaultLocale from './en.js' ;
14
+
15
+ export { registerWith } ;
16
+
17
+ export function __addLocaleData ( data ) {
18
+ IntlMessageFormat . __addLocaleData ( data ) ;
19
+ IntlRelativeFormat . __addLocaleData ( data ) ;
20
+ }
21
+
22
+ __addLocaleData ( defaultLocale ) ;
Original file line number Diff line number Diff line change @@ -17,9 +17,9 @@ import {
17
17
getFormatOptions ,
18
18
getLocales ,
19
19
tap
20
- } from './utils' ;
20
+ } from './utils.js ' ;
21
21
22
- export { registerWith , __addLocaleData } ;
22
+ export { registerWith } ;
23
23
24
24
// -----------------------------------------------------------------------------
25
25
@@ -62,11 +62,6 @@ function deprecate(name, suggestion) {
62
62
} ;
63
63
}
64
64
65
- function __addLocaleData ( data ) {
66
- IntlMessageFormat . __addLocaleData ( data ) ;
67
- IntlRelativeFormat . __addLocaleData ( data ) ;
68
- }
69
-
70
65
// -- Helpers ------------------------------------------------------------------
71
66
72
67
/**
Original file line number Diff line number Diff line change @@ -6,10 +6,7 @@ See the accompanying LICENSE file for terms.
6
6
7
7
/* jshint esnext: true */
8
8
9
- import { registerWith , __addLocaleData } from './helpers' ;
10
- import defaultLocale from './en' ;
11
-
12
- __addLocaleData ( defaultLocale ) ;
9
+ import { registerWith , __addLocaleData } from './dust-intl.js' ;
13
10
14
11
// Re-export as default for
15
12
export default {
You can’t perform that action at this time.
0 commit comments