mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-10-02 21:33:52 +02:00
Add improved logic for loading Node.js module (fixes #118)
This commit is contained in:
@@ -24,7 +24,7 @@ const walkDir = (dir: string) => {
|
||||
const fixFile = (filePath: string) => {
|
||||
const content = fs.readFileSync(filePath, 'utf8');
|
||||
const fixed = content.replace(
|
||||
/(\s+from\s+['"])([^'"]*)(['"])/g,
|
||||
/(\s+from\s+['"])(\.[^'"]*)(['"])/g, // This only matches relative imports
|
||||
'$1$2.js$3',
|
||||
);
|
||||
|
||||
|
||||
@@ -16,6 +16,9 @@ const createVariants = async (
|
||||
entryPoints: [entryPoint],
|
||||
bundle: true,
|
||||
logLevel: 'info',
|
||||
logOverride: {
|
||||
'import-is-undefined': 'silent', // Warning caused by the disabled "node.ts" import
|
||||
},
|
||||
banner: {
|
||||
js: `/*!
|
||||
* Copyright (c) 2025-present, Vanilagy and contributors
|
||||
|
||||
Reference in New Issue
Block a user