Skip to content

Commit

Permalink
feat: add core ES module. (#6287)
Browse files Browse the repository at this point in the history
Allows you to do `import videojs from 'video.js/core.es.js';` to go along with `require('video.js/core.js')`;
  • Loading branch information
gjanblaszczyk authored and gkatsev committed Nov 15, 2019
1 parent f7b3772 commit 4f8c498
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ es5/*
.idea/

core.js
core.es.js

# Ignore Chinese clones for now.
lang/zh-Han*.json
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ dist/video-js-*.zip
!es5/**
!src/css/**
!core.js
!core.es.js
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@
"sandbox",
"test/dist",
"test/api",
"core.js"
"core.js",
"core.es.js"
]
},
"greenkeeper": {
Expand Down
24 changes: 16 additions & 8 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit 4f8c498

Please sign in to comment.