A webpack plugin that downloads youtube-dl
- Auto install the latest or specific
youtube-dl
version available as webpack plugin.
npm install --save-dev youtube-dl-downloader-wepback-plugin
const { YoutubeDlDownloaderPlugin } = require("youtube-dl-downloader-wepback-plugin");
const webpackConfig = {
plugins: [
new YoutubeDlDownloaderPlugin({
from: 'website',
to: 'lib'
})
],
};
module.exports = webpackConfig;
new YoutubeDlDownloaderPlugin({
/**
* A platform of youtube-dl ('win32', 'auto' or 'not')
*
* default: ['win32', 'unix']
*/
platform?: string[] | string;
/**
* 'github' or 'website'; server where would like to download
*
* default: 'website'
*/
from?: DownloadFrom;
/**
* When {from: 'github'}, a version to download youtube-dl from github releases
*
* default: [lastest version]
*/
version?: string;
/**
* A version to download youtube-dl
*/
to: string;
/**
* use EnableDefine
*
* default: false
*/
enableDefine?: boolean;
});