Permalink
Browse files

feat(lang): copy language JSON files into dist dir (#5549)

This helps with ESM import and bundler users can then import the JSON files directly and register the languages manually. For example:
```js
import es from 'video.js/dist/lang/es.json';

videojs(element, {
  language: 'es',
  languages: {
    es
  }
});
```

Related issue: #5092
  • Loading branch information...
eranshmil authored and gkatsev committed Nov 5, 2018
1 parent 2d27b6a commit eb5de19fea3effcece2f829a74971c0185a6bf87
Showing with 2 additions and 0 deletions.
  1. +2 −0 build/grunt.js
@@ -31,6 +31,7 @@ module.exports = function(grunt) {
},
copy: {
fonts: { cwd: 'node_modules/videojs-font/fonts/', src: ['*'], dest: 'build/temp/font/', expand: true, filter: 'isFile' },
lang: { cwd: 'lang/', src: ['*'], dest: 'dist/lang/', expand: true, filter: 'isFile' },
dist: { cwd: 'build/temp/', src: ['**/**', '!test*'], dest: 'dist/', expand: true, filter: 'isFile' },
a11y: { src: 'sandbox/descriptions.html.example', dest: 'sandbox/descriptions.test-a11y.html' }, // Can only test a file with a .html or .htm extension
examples: { cwd: 'docs/examples/', src: ['**/**'], dest: 'dist/examples/', expand: true, filter: 'isFile' }
@@ -189,6 +190,7 @@ module.exports = function(grunt) {
'shell:cssmin',

'copy:fonts',
'copy:lang',
'vjslanguages'
]);

0 comments on commit eb5de19

Please sign in to comment.