mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
do not transform rquire context when not in test mode
This commit is contained in:
parent
0384bdd0ee
commit
79aeb8affb
@ -1,4 +1,15 @@
|
|||||||
module.exports = {
|
module.exports = function (api) {
|
||||||
presets: ['@babel/preset-env'],
|
api.cache(true)
|
||||||
plugins: ['transform-require-context'],
|
|
||||||
|
const presets = ['@babel/preset-env']
|
||||||
|
const plugins = []
|
||||||
|
|
||||||
|
if (process.env.NODE_ENV === 'test') {
|
||||||
|
plugins.push('transform-require-context')
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
presets,
|
||||||
|
plugins,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,11 +4,9 @@ import VueI18n from 'vue-i18n'
|
|||||||
Vue.use(VueI18n)
|
Vue.use(VueI18n)
|
||||||
|
|
||||||
const loadLocaleMessages = () => {
|
const loadLocaleMessages = () => {
|
||||||
const locales = require.context('./locales', true, /[A-Za-z0-9-_,\s]+\.json$/i)
|
const locales = require.context('./locales/', true, /[A-Za-z0-9-_,\s]+\.json$/i)
|
||||||
console.log(locales)
|
|
||||||
const messages = {}
|
const messages = {}
|
||||||
locales.keys().forEach((key) => {
|
locales.keys().forEach((key) => {
|
||||||
console.log(key)
|
|
||||||
const matched = key.match(/([A-Za-z0-9-_]+)\./i)
|
const matched = key.match(/([A-Za-z0-9-_]+)\./i)
|
||||||
if (matched && matched.length > 1) {
|
if (matched && matched.length > 1) {
|
||||||
const locale = matched[1]
|
const locale = matched[1]
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
{
|
{
|
||||||
"open_creations":"offene Schöpfungen",
|
"not_open_creations": "keine offene Schöpfungen",
|
||||||
"not_open_creations":"keine offene Schöpfungen"
|
"open_creations": "offene Schöpfungen"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
{
|
{
|
||||||
"open_creations":"open creations",
|
"not_open_creations": "No open creations",
|
||||||
"not_open_creations":"not open creations"
|
"open_creations": "Open creations"
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user