1
0
mirror of https://github.com/videojs/video.js.git synced 2024-12-21 01:39:04 +02:00

feat: add core ES module. (#6287)

Allows you to do `import videojs from 'video.js/core.es.js';` to go along with `require('video.js/core.js')`;
This commit is contained in:
Grzegorz Blaszczyk 2019-11-15 19:44:11 +01:00 committed by Gary Katsevman
parent f7b3772e27
commit 4f8c4988d2
4 changed files with 20 additions and 9 deletions

1
.gitignore vendored
View File

@ -34,6 +34,7 @@ es5/*
.idea/
core.js
core.es.js
# Ignore Chinese clones for now.
lang/zh-Han*.json

View File

@ -5,3 +5,4 @@ dist/video-js-*.zip
!es5/**
!src/css/**
!core.js
!core.es.js

View File

@ -158,7 +158,8 @@
"sandbox",
"test/dist",
"test/api",
"core.js"
"core.js",
"core.es.js"
]
},
"greenkeeper": {

View File

@ -186,16 +186,24 @@ export default cliargs => [
onwarn,
watch
},
// core
// core cjs, es
{
input: 'src/js/video.js',
output: {
format: 'cjs',
file: 'core.js',
strict: false,
banner,
globals: globals.module
},
output: [
{
format: 'es',
file: 'core.es.js',
strict: false,
banner,
globals: globals.module
}, {
format: 'cjs',
file: 'core.js',
strict: false,
banner,
globals: globals.module
}
],
external: externals.module,
plugins: [
json(),