Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const watch = {
clearScreen: false
};
const onwarn = (warning) => {
// ignore unknow option for --no-progress
if (warning.code === 'UNKNOWN_OPTION' && warning.message.indexOf('progress') !== -1) {
return;
}
// eslint-disable-next-line no-console
console.warn(warning.message);
};
const primedIgnore = ignore(['videojs-vtt.js']);
const primedResolve = resolve({
mainFields: ['jsnext:main', 'module', 'main'],
browser: true
});
const primedCjs = commonjs({
sourceMap: false
});
const primedBabel = babel({
runtimeHelpers: true,
babelrc: false,
exclude: 'node_modules/**(!http-streaming)',
compact: false,
presets: [
['@babel/preset-env', {
loose: true,
modules: false
/**
* Core video.js without vtt.js
*/
const novttCoreUmd = Object.assign({}, _.cloneDeep(coreUmd), {
banner: compiledLicense(Object.assign({includesVtt: false}, bannerData)),
dest: 'dist/alt/video.core.novtt.js'
});
novttCoreUmd.options.plugins.unshift(ignore(['videojs-vtt.js']));
const minifiedNovttCoreUmd = Object.assign({}, _.cloneDeep(minifiedCoreUmd), {
banner: compiledLicense(Object.assign({includesVtt: false}, bannerData)),
dest: 'dist/alt/video.core.novtt.min.js'
});
minifiedNovttUmd.options.plugins.unshift(ignore(['videojs-vtt.js']));
function runRollup({options, useStrict, format, dest, banner}) {
rollup(options)
.then(function(bundle) {
bundle.write({
useStrict,
format,
dest,
banner,
moduleName: 'videojs',
sourceMap: false
});
}, function(err) {
// eslint-disable-next-line no-console
console.error(err);
});
{
...base.output,
file: `${output}.browser.es.js`,
format: 'es'
},
{
...base.output,
file: `${output}.browser.cjs.js`,
format: 'cjs'
}
],
plugins: base.plugins.concat(
replace({
__SERVER__: JSON.stringify(false)
}),
ignore(['stream'])
)
}
return [devUmd, prodUmd, serverConfig, browserConfig]
}
assetPaths: config.assetPaths
}),
postCssAutoPrefix,
])
.process(css, { from: undefined })
.then(result => result.css)
}
})
};
const rollupReplacePlugin = rollupReplace({
patterns: config.pathReplacePatterns
});
const resolvePlugins = [
rollupIgnore(config.ignore),
rollupResolve({
jsnext: true,
main: true,
browser: true,
preferBuiltins: false
}),
rollupCommonjs({
include: 'node_modules/**'
})
];
const buildPlugin = (esVersion, generateDefinition, watch) => {
if (config.tsProject) {
let buildConf = {
tsconfig: `tsconfig.${esVersion}.json`,
typescript: typescript,
if (isUmdBuild || isEsmBrowserBuild || dependencies === undefined) {
dependencies = [];
}
rollupConfig.push({
input: packageResolve(packageConfig.input),
external: Object.keys(dependencies).concat(packageConfig.external),
plugins: [
json({
namedExports: false,
}),
globals({
global: true,
}),
ignore(packageConfig.ignore || []),
ts({
check: !hasTSChecked,
tsconfig: path.resolve(__dirname, 'tsconfig.json'),
cacheRoot: path.resolve(__dirname, 'node_modules/.rts2_cache'),
tsconfigOverride: {
include: ['packages/**/src/**/*.ts'],
exclude: ['packages/**/src/__tests__/**/*.ts'],
compilerOptions: {
declaration: !hasTSChecked,
declarationMap: !hasTSChecked,
},
},
}),
alias(aliasOptions),
...transpilerPlugins,
...compressorPlugins,