Closed xehpuk closed 5 months ago
Please, can you share in a gist a minimum way to reproducible the issue you see?
require('cldr-data')
can't be used with webpack because when it sees dynamic imports, webpack simply includes everything.
It works including things explicitly such as import enNumbers from "cldr-data/main/en/numbers.json"
(tedious). A better alternative is using plugins such as globalize webpack plugin (if using globalize).
We need to update README.md to reflect this. Do you want to help?
require('cldr-data')
can't be used with webpack because when it sees dynamic imports, webpack simply includes everything.It works including things explicitly such as
import enNumbers from "cldr-data/main/en/numbers.json"
(tedious). A better alternative is using plugins such as globalize webpack plugin (if using globalize).We need to update README.md to reflect this. Do you want to help?
Using the import syntax stops the heap overflow, but it still doesn't compile for me.
ERROR in ./node_modules/globalize/dist/globalize/number.js
Module not found: Error: Can't resolve 'cldr/supplemental' in '/Users/me/Workspace/my_app/node_modules/globalize/dist/globalize'
@ ./node_modules/globalize/dist/globalize/number.js 22:2-27:14
@ ./node_modules/globalize/dist/node-main.js
@ ./client/js/filters/compactNumber.js
@ ./client/js/filters \.js$
@ ./client/app.js
@ multi (webpack)-dev-server/client?http://0.0.0.0:9000 webpack/hot/dev-server babel-polyfill ./client/app.js
I'm trying to use Globalize.numberFormatter
. Here's what I'm trying to load:
let Globalize = require('globalize');
// minimum required cldr-data to use Globalize.numberFormatter({ compact: 'short', maximumFractionDigits: 0 })
// generated by http://johnnyreilly.github.io/globalize-so-what-cha-want/#/?currency=false&date=false&message=false&number=true&plural=false&relativeTime=false&unit=false
import enNumbers from 'cldr-data/main/en/numbers.json';
import likelySubtags from 'cldr-data/supplemental/likelySubtags.json';
import numbers from 'cldr-data/supplemental/numberingSystems.json';
Globalize.load(enNumbers);
Globalize.load(likelySubtags);
Globalize.load(numbers);
A better alternative is using plugins such as globalize webpack plugin (if using globalize)
This seems unmaintained. Trying to install causes conflicts for me because it's webpack dependency is too old
Similar error caused by the inflight
package: https://github.com/isaacs/inflight/issues/5
I have a file with the line
const cldr = require('cldr-data')
. When importing the file, Node eats more and more RAM until…What's wrong here?