Skip to content
This repository was archived by the owner on Sep 28, 2025. It is now read-only.
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
24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,20 @@
"@clappr/core": "^0.4.17"
},
"devDependencies": {
"@babel/core": "^7.12.10",
"@babel/preset-env": "^7.12.11",
"babel-loader": "^8.2.2",
"@babel/core": "^7.22.17",
"@babel/preset-env": "^7.22.15",
"babel-loader": "^9.1.3",
"babel-plugin-add-module-exports": "^1.0.4",
"eslint": "^7.18.0",
"eslint-config-standard": "^16.0.2",
"eslint-plugin-import": "^2.22.1",
"eslint": "^8.49.0",
"eslint-config-standard": "^17.1.0",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-standard": "^4.1.0",
"shaka-player": "^3.0.7",
"uglifyjs-webpack-plugin": "^2.2.0",
"webpack": "^4.46.0",
"webpack-cli": "^3.3.12",
"webpack-dev-server": "^3.11.2"
"shaka-player": "^4.4.1",
"terser-webpack-plugin": "^5.3.9",
"webpack": "^5.88.2",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.15.1"
}
}
58 changes: 33 additions & 25 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const path = require('path')
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
const TerserPlugin = require('terser-webpack-plugin')

var NPM_RUN = process.env.npm_lifecycle_event

Expand All @@ -18,16 +18,16 @@ const externals = () => {
const webpackConfig = (config) => {
return {
devServer: {
contentBase: [
path.resolve(__dirname, 'public'),
],
disableHostCheck: true, // https://github.com/webpack/webpack-dev-server/issues/882
static: {
directory: path.resolve(__dirname, 'public'),
},
allowedHosts: 'all',
compress: true,
host: '0.0.0.0',
port: 8181
},
host: 'localhost',
port: config.port
},
mode: config.mode,
devtool: 'source-maps',
devtool: 'eval-source-map',
entry: path.resolve(__dirname, 'src/clappr-dash-shaka-playback.js'),
externals: config.externals,
module: {
Expand All @@ -42,8 +42,8 @@ const webpackConfig = (config) => {
],
},
output: {
path: path.resolve(__dirname, 'dist'),
publicPath: 'dist/',
path: path.resolve(__dirname, 'public/dist/'),
publicPath: 'public/dist/',
filename: config.filename,
library: 'DashShakaPlayback',
libraryTarget: 'umd',
Expand All @@ -60,17 +60,19 @@ if (NPM_RUN === 'build' || NPM_RUN === 'start') {
filename: 'dash-shaka-playback.js',
plugins: [],
externals: externals(),
mode: 'development'
mode: 'development',
port: '8181',
}))

// Unminified bundle without shaka-player
var customExt = externals()
const customExt = externals()
customExt['shaka-player'] = 'shaka'
configurations.push(webpackConfig({
filename: 'dash-shaka-playback.external.js',
plugins: [],
externals: customExt,
mode: 'development'
mode: 'development',
port: '8182',
}))
}

Expand All @@ -79,27 +81,33 @@ if (NPM_RUN === 'release') {
configurations.push(webpackConfig({
filename: 'dash-shaka-playback.min.js',
optimization: {
minimizer: [
new UglifyJsPlugin({
sourceMap: true
}),
]
minimizer: [new TerserPlugin({
extractComments: false,
terserOptions: {
format: {
comments: false,
},
},
})],
},
externals: externals(),
mode: 'production'
}))

// Minified bundle without shaka-player
var customExt = externals()
const customExt = externals()
customExt['shaka-player'] = 'shaka'
configurations.push(webpackConfig({
filename: 'dash-shaka-playback.external.min.js',
optimization: {
minimizer: [
new UglifyJsPlugin({
sourceMap: true
}),
]
minimizer: [new TerserPlugin({
extractComments: false,
terserOptions: {
format: {
comments: false,
},
},
})],
},
externals: customExt,
mode: 'production'
Expand Down
Loading