<commit_before>import gulp from "gulp"
import del from "del"
import fs from "fs"
import extractData from "formatjs-extract-cldr-data"
import stringify from "javascript-stringify"
import { map } from "lodash"

gulp.task("clean-data", function()
{
  return del([ "data/*" ])
})

gulp.task("build-data", function()
{
  let data = extractData(
  {
    pluralRules: true,
    relativeFields: true
  })

  return Promise.all(map(data, (value, locale) =>
  {
    return new Promise((resolve) =>
    {
      let stringified = stringify(value, null, "  ")
      let result = `"use strict";exports.default=${stringified};`

      fs.writeFile("data/" + locale + ".js", result, resolve)
    })
  }))
})<commit_msg>Tried further approach. JSPM still does not work correctly with previous approach<commit_after>import gulp from "gulp"
import del from "del"
import fs from "fs"
import extractData from "formatjs-extract-cldr-data"
import stringify from "javascript-stringify"
import { map } from "lodash"

gulp.task("clean-data", function()
{
  return del([ "data/*" ])
})

gulp.task("build-data", function()
{
  let data = extractData(
  {
    pluralRules: true,
    relativeFields: true
  })

  return Promise.all(map(data, (value, locale) =>
  {
    return new Promise((resolve) =>
    {
      let stringified = stringify(value, null, "  ")
      let result = `"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=${stringified};`

      fs.writeFile("data/" + locale + ".js", result, resolve)
    })
  }))
})
{'fraction_non_alphanumeric': 0.1541476159372959, 'fraction_numerical': 0.0, 'mean_word_length': 3.878980891719745, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '574778', 'n_tokens_mistral': 500, 'n_tokens_neox': 493, 'n_words': 127}