Use smaller web version of linkedom (#3115)

This commit is contained in:
absidue 2023-01-25 21:21:31 +01:00 committed by GitHub
parent 14caa8ccad
commit e140d5ef98
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 4 deletions

View File

@ -32,10 +32,6 @@ const config = {
path: path.join(__dirname, '../dist'),
filename: '[name].js',
},
externals: {
// ignore linkedom's unnecessary broken canvas import, as youtubei.js only uses linkedom to generate DASH manifests
canvas: '{}'
},
module: {
rules: [
{
@ -133,6 +129,9 @@ const config = {
alias: {
vue$: 'vue/dist/vue.common.js',
// use the web version of linkedom
linkedom$: 'linkedom/worker',
// defaults to the prebundled browser version which causes webpack to error with:
// "Critical dependency: require function is used in a way in which dependencies cannot be statically extracted"
// webpack likes to bundle the dependencies itself, could really have a better error message though