mirror of
https://gitlab.com/vyla-entertainment/TV.git
synced 2026-11-15 20:47:19 -05:00
playback improvements, dependancy updates, and updated SDK
This commit is contained in:
@@ -56,14 +56,52 @@ globalThis.VylaLocal = {
|
||||
`;
|
||||
fs.writeFileSync(path.join(tmp, 'entry.js'), entry);
|
||||
|
||||
const nodeStubPlugin = {
|
||||
name: 'node-stub',
|
||||
setup(build) {
|
||||
build.onResolve(
|
||||
{
|
||||
filter: /^(node:|fs(\/promises)?$|path$|crypto$|https$|http$|events$|os$|stream$|util$|url$|zlib$|net$|tls$|child_process$|worker_threads$|async_hooks$|perf_hooks$|readline$|koffi$|piscina$|node-tls-client$)/,
|
||||
},
|
||||
(args) => ({
|
||||
path: args.path,
|
||||
namespace: 'node-stub',
|
||||
})
|
||||
);
|
||||
|
||||
build.onLoad({ filter: /^node-tls-client$/, namespace: 'node-stub' }, () => ({
|
||||
contents: `
|
||||
export const ClientIdentifier = {};
|
||||
export const destroyTLS = async () => {};
|
||||
export const initTLS = async () => {};
|
||||
export class Session {
|
||||
async get() { throw new Error('node-tls-client not supported in webview'); }
|
||||
async post() { throw new Error('node-tls-client not supported on webview'); }
|
||||
async close() {}
|
||||
}
|
||||
export default { ClientIdentifier, destroyTLS, initTLS, Session };
|
||||
`,
|
||||
loader: 'js',
|
||||
}));
|
||||
|
||||
build.onLoad({ filter: /.*/, namespace: 'node-stub' }, () => ({
|
||||
contents: 'module.exports = {};',
|
||||
loader: 'js',
|
||||
}));
|
||||
},
|
||||
};
|
||||
|
||||
await build({
|
||||
entryPoints: [path.join(tmp, 'entry.js')],
|
||||
bundle: true,
|
||||
format: 'iife',
|
||||
target: 'chrome70',
|
||||
platform: 'browser',
|
||||
plugins: [nodeStubPlugin],
|
||||
minify: true,
|
||||
alias: { 'node:crypto': path.join(shim, 'crypto.js') },
|
||||
alias: {
|
||||
'node:crypto': path.join(shim, 'crypto.js')
|
||||
},
|
||||
inject: [path.join(shim, 'inject.js')],
|
||||
outfile: path.join(www, 'js/vyla-local.js'),
|
||||
logLevel: 'info'
|
||||
|
||||
1
scripts/empty-shim.js
Normal file
1
scripts/empty-shim.js
Normal file
@@ -0,0 +1 @@
|
||||
export default {};
|
||||
Reference in New Issue
Block a user