Skip to content

Commit

Permalink
Fix vite issue
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromewu committed Aug 23, 2022
1 parent bb36ae8 commit d824045
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/browser/defaultOptions.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
const { devDependencies } = require('../../package.json');
import pkg from '../../package.json';

/*
* Default options for browser environment
*/
const corePath = typeof process !== 'undefined' && process.env.NODE_ENV === 'development'
? new URL('/node_modules/@ffmpeg/core/dist/ffmpeg-core.js', import.meta.url).href
: `https://unpkg.com/@ffmpeg/core@${devDependencies['@ffmpeg/core'].substring(1)}/dist/ffmpeg-core.js`;
: `https://unpkg.com/@ffmpeg/core@${pkg.devDependencies['@ffmpeg/core'].substring(1)}/dist/ffmpeg-core.js`;

export default { corePath };
6 changes: 3 additions & 3 deletions src/browser/getCreateFFmpegCore.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* eslint-disable no-undef */
const { log } = require('../utils/log');
const {
import { log } from '../utils/log';
import {
CREATE_FFMPEG_CORE_IS_NOT_DEFINED,
} = require('../utils/errors');
} from '../utils/errors';

/*
* Fetch data from remote URL and convert to blob URL
Expand Down
6 changes: 3 additions & 3 deletions src/browser/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const defaultOptions = require('./defaultOptions');
const { getCreateFFmpegCore } = require('./getCreateFFmpegCore');
const { fetchFile } = require('./fetchFile');
import defaultOptions from './defaultOptions';
import { getCreateFFmpegCore } from './getCreateFFmpegCore';
import { fetchFile } from './fetchFile';

export { defaultOptions, getCreateFFmpegCore, fetchFile };

0 comments on commit d824045

Please sign in to comment.