Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix exports of ogv-support.js/ogv-version.js + some JS build clean-up #620

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 42 additions & 36 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
"dist/"
],
"scripts": {
"prepublish": "make -j4 dist",
"build": "webpack",
"prepack": "make -j4 dist",
"build": "webpack --mode=production",
"lint": "eslint src/js",
"test": "make tests && npx static build/tests",
"demo": "webpack serve --open-page=build/demo",
"start": "webpack serve"
"demo": "webpack serve --mode=development --open-page=build/demo",
"start": "webpack serve --mode=development"
},
"repository": {
"type": "git",
Expand Down
6 changes: 0 additions & 6 deletions src/js/ogv-support.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@
import OGVCompat from './OGVCompat.js';
const OGVVersion = __OGV_FULL_VERSION__;

if (typeof window === 'object') {
// 1.0-compat globals
window.OGVCompat = OGVCompat;
window.OGVVersion = OGVVersion;
}

export {
OGVCompat,
OGVVersion
Expand Down
5 changes: 0 additions & 5 deletions src/js/ogv-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,4 @@

const OGVVersion = __OGV_FULL_VERSION__;

if (typeof window === 'object') {
// 1.0-compat globals
window.OGVVersion = OGVVersion;
}

export {OGVVersion};
11 changes: 0 additions & 11 deletions src/js/ogv.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,6 @@ import OGVPlayer from './OGVPlayer.js';
import OGVTimeRanges from './OGVTimeRanges.js';
const OGVVersion = __OGV_FULL_VERSION__;

// Version 1.0's web-facing and test-facing interfaces
if (typeof window === 'object') {
window.OGVCompat = OGVCompat;
window.OGVLoader = OGVLoader;
window.OGVMediaError = OGVMediaError; // exposed for testing, for now
window.OGVMediaType = OGVMediaType;
window.OGVTimeRanges = OGVTimeRanges; // exposed for testing, for now
window.OGVPlayer = OGVPlayer;
window.OGVVersion = OGVVersion;
}

export {
OGVCompat,
OGVLoader,
Expand Down
30 changes: 18 additions & 12 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,14 @@ module.exports = [
{
// Main entry point! - ES Module
entry: './src/js/ogv.js',
mode: 'production',
output: {
path: path.resolve(__dirname, BUILD_DIR),
publicPath: publicPath(),
filename: 'ogv-es2017.js',
libraryTarget: 'umd',
library: 'ogvjs'
library: {
// `library.name` is omitted, since we want exports to be assigned directly to the root object
type: 'umd'
}
},
plugins: plugins,
module: {
Expand All @@ -114,13 +115,14 @@ module.exports = [
{
// Main entry point! - ES5
entry: './src/js/ogv.js',
mode: 'production',
output: {
path: path.resolve(__dirname, BUILD_DIR),
publicPath: publicPath(),
filename: 'ogv.js',
libraryTarget: 'umd',
library: 'ogvjs'
library: {
// `library.name` is omitted, since we want exports to be assigned directly to the root object
type: 'umd'
}
},
plugins: plugins,
module: {
Expand All @@ -134,11 +136,14 @@ module.exports = [
{
// Alt limited entry point for compat testing before loading
entry: './src/js/ogv-support.js',
mode: 'production',
output: {
path: path.resolve(__dirname, BUILD_DIR),
publicPath: publicPath(),
filename: 'ogv-support.js'
filename: 'ogv-support.js',
library: {
// `library.name` is omitted, since we want exports to be assigned directly to the root object
type: 'umd'
}
},
plugins: plugins,
module: {
Expand All @@ -151,11 +156,14 @@ module.exports = [
{
// Alt limited entry point for just exposting the version marker string
entry: './src/js/ogv-version.js',
mode: 'production',
output: {
path: path.resolve(__dirname, BUILD_DIR),
publicPath: publicPath(),
filename: 'ogv-version.js'
filename: 'ogv-version.js',
library: {
// `library.name` is omitted, since we want exports to be assigned directly to the root object
type: 'umd'
}
},
plugins: plugins,
module: {
Expand All @@ -168,7 +176,6 @@ module.exports = [
},
{
entry: './src/js/workers/ogv-worker-audio.js',
mode: 'production',
output: {
path: path.resolve(__dirname, BUILD_DIR),
publicPath: publicPath(),
Expand All @@ -185,7 +192,6 @@ module.exports = [
},
{
entry: './src/js/workers/ogv-worker-video.js',
mode: 'production',
output: {
path: path.resolve(__dirname, BUILD_DIR),
publicPath: publicPath(),
Expand Down