Skip to content

Latest commit

 

History

History
43 lines (38 loc) · 1.13 KB

README.md

File metadata and controls

43 lines (38 loc) · 1.13 KB

ngx-translate yaml

Travis CI

Important parts of the webpack config

let languages = fs.readdirSync(path.join(__dirname, 'src', 'i18n'))
  .map(file => path.join(__dirname, 'src', 'i18n', file))
  .filter(path => !fs.statSync(path).isDirectory());

let partialWebpackConfig = {
  entry: {
    main: [
      ...languages,
      path.join(__dirname, 'src', 'main.ts')
    ]
  },

  module: {
    rules: [
      {
        test: /\.ya?ml$/,
        use: [
          {
            loader: 'file-loader',
            options: { name: 'assets/i18n/[name].json' }
          },
          {
            loader: 'yaml-import-loader',
            options: { importRoot: true, output: 'json' }
          }
        ],
        include: path.join(__dirname, 'src', 'i18n')
      }
    ]
  }
}