Simplify yaml loading

This commit is contained in:
Chi Vinh Le
2017-05-24 00:26:55 +07:00
parent adacafb586
commit 48bef95a4d
2 changed files with 8 additions and 10 deletions
+2 -2
View File
@@ -9,8 +9,8 @@ const esTA = require('../../../node_modules/timeago.js/locales/es');
const defaultLanguage = 'en';
const locales = Object.assign(
require('json-loader!yaml-loader!../locales/en.yml'),
require('json-loader!yaml-loader!../locales/es.yml')
require('../locales/en.yml'),
require('../locales/es.yml')
);
let translations = {};
+6 -8
View File
@@ -24,8 +24,6 @@ if (process.env.TALK_PLUGINS_JSON && process.env.TALK_PLUGINS_JSON.length > 0) {
pluginsConfigPath = defaultPlugins;
}
let localesPath = path.join(__dirname, 'locales');
console.log(`Using ${pluginsConfigPath} as the plugin configuration path`);
// Edit the build targets and embeds below.
@@ -91,9 +89,14 @@ const config = {
},
{
loader: 'json-loader',
test: /\.json$/,
test: /\.(json|yml)$/,
exclude: /node_modules/
},
{
loader: 'yaml-loader',
exclude: /node_modules/,
test: /\.yml$/,
},
{
loaders: [
'style-loader',
@@ -118,11 +121,6 @@ const config = {
test: /\.(graphql|gql)$/,
exclude: /node_modules/,
loader: 'graphql-tag/loader'
},
{
loader: 'yaml',
include: localesPath,
test: /\.yml$/,
}
]
},