fix: babel jassub worker
This commit is contained in:
parent
71e9b46a81
commit
434029dae9
3 changed files with 19 additions and 13 deletions
|
@ -12,14 +12,7 @@ module.exports = {
|
||||||
corejs: 3
|
corejs: 3
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
'@babel/preset-react',
|
'@babel/preset-react'
|
||||||
[
|
|
||||||
'@babel/preset-typescript',
|
|
||||||
{
|
|
||||||
isTSX: true,
|
|
||||||
allExtensions: true
|
|
||||||
}
|
|
||||||
]
|
|
||||||
],
|
],
|
||||||
plugins: [
|
plugins: [
|
||||||
'@babel/plugin-proposal-class-properties',
|
'@babel/plugin-proposal-class-properties',
|
||||||
|
|
|
@ -1213,8 +1213,10 @@ function tryRemoveElement(elem) {
|
||||||
fonts: avaliableFonts,
|
fonts: avaliableFonts,
|
||||||
fallbackFont: 'liberation sans',
|
fallbackFont: 'liberation sans',
|
||||||
availableFonts: {'liberation sans': `${appRouter.baseUrl()}/libraries/default.woff2`},
|
availableFonts: {'liberation sans': `${appRouter.baseUrl()}/libraries/default.woff2`},
|
||||||
workerUrl: `${appRouter.baseUrl()}/libraries/jassub-worker.js`,
|
// eslint-disable-next-line compat/compat
|
||||||
legacyWorkerUrl: `${appRouter.baseUrl()}/libraries/jassub-worker-legacy.js`,
|
workerUrl: `${appRouter.baseUrl()}/${new URL('jassub/dist/jassub-worker.js', import.meta.url)}`,
|
||||||
|
// eslint-disable-next-line compat/compat
|
||||||
|
legacyWorkerUrl: `${appRouter.baseUrl()}/${new URL('jassub/dist/jassub-worker-legacy.js', import.meta.url)}`,
|
||||||
timeOffset: (this._currentPlayOptions.transcodingOffsetTicks || 0) / 10000000,
|
timeOffset: (this._currentPlayOptions.transcodingOffsetTicks || 0) / 10000000,
|
||||||
// new jassub options; override all, even defaults
|
// new jassub options; override all, even defaults
|
||||||
blendMode: 'js',
|
blendMode: 'js',
|
||||||
|
|
|
@ -8,9 +8,7 @@ const { DefinePlugin } = require('webpack');
|
||||||
const Assets = [
|
const Assets = [
|
||||||
'native-promise-only/npo.js',
|
'native-promise-only/npo.js',
|
||||||
'libarchive.js/dist/worker-bundle.js',
|
'libarchive.js/dist/worker-bundle.js',
|
||||||
'jassub/dist/jassub-worker.js',
|
|
||||||
'jassub/dist/jassub-worker.wasm',
|
'jassub/dist/jassub-worker.wasm',
|
||||||
'jassub/dist/jassub-worker-legacy.js',
|
|
||||||
'jassub/dist/jassub-worker-legacy.mem',
|
'jassub/dist/jassub-worker-legacy.mem',
|
||||||
'jassub/dist/default.woff2',
|
'jassub/dist/default.woff2',
|
||||||
'pdfjs-dist/build/pdf.worker.js'
|
'pdfjs-dist/build/pdf.worker.js'
|
||||||
|
@ -146,7 +144,6 @@ const config = {
|
||||||
{
|
{
|
||||||
test: /\.(js|jsx)$/,
|
test: /\.(js|jsx)$/,
|
||||||
include: [
|
include: [
|
||||||
path.resolve(__dirname, 'node_modules/jassub'),
|
|
||||||
path.resolve(__dirname, 'node_modules/rvfc-polyfill'),
|
path.resolve(__dirname, 'node_modules/rvfc-polyfill'),
|
||||||
path.resolve(__dirname, 'node_modules/@jellyfin/sdk'),
|
path.resolve(__dirname, 'node_modules/@jellyfin/sdk'),
|
||||||
path.resolve(__dirname, 'node_modules/@remix-run/router'),
|
path.resolve(__dirname, 'node_modules/@remix-run/router'),
|
||||||
|
@ -174,6 +171,20 @@ const config = {
|
||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
test: /\.js$/,
|
||||||
|
include: [
|
||||||
|
path.resolve(__dirname, 'node_modules/jassub')
|
||||||
|
],
|
||||||
|
use: [{
|
||||||
|
loader: 'babel-loader',
|
||||||
|
options: {
|
||||||
|
cacheCompression: false,
|
||||||
|
cacheDirectory: true,
|
||||||
|
presets: ['@babel/preset-env']
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
test: /\.worker\.ts$/,
|
test: /\.worker\.ts$/,
|
||||||
exclude: /node_modules/,
|
exclude: /node_modules/,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue