mirror of
https://github.com/wassname/talk.git
synced 2026-07-21 12:51:03 +08:00
Simplify yaml loading
This commit is contained in:
@@ -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
@@ -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$/,
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user