Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
task('build:electron', () => {
build({
electronVersion: argv().electron_version,
runtime: argv().runtime,
platform: argv().platform,
packageVersion,
debug: argv().debug,
silent: argv().silent,
msvsVersion: argv().msvs_version
})
})
// npm run build:node --
task('build:electron', () => {
build({
electronVersion: argv().electron_version,
runtime: argv().runtime,
platform: argv().platform,
packageVersion,
debug: argv().debug,
silent: argv().silent,
msvsVersion: argv().msvs_version
})
})
// npm run build:node --
task('build:node', () => {
build({
electronVersion: argv().electron_version,
runtime: 'node',
packageVersion,
platform: argv().platform,
debug: argv().debug,
silent: argv().silent,
msvsVersion: argv().msvs_version
})
})
// npm run download --
return;
}
logger.info(`Running Webpack`);
const webpackConfigPath = resolveCwd((options && options.config) || 'webpack.config.js');
logger.info(`Webpack Config Path: ${webpackConfigPath}`);
if (webpackConfigPath && fs.existsSync(webpackConfigPath)) {
const configLoader = require(webpackConfigPath);
let webpackConfigs: Configuration[];
// If the loaded webpack config is a function
// call it with the original process.argv arguments from build.js.
if (typeof configLoader == 'function') {
webpackConfigs = configLoader(argv());
} else {
webpackConfigs = configLoader;
}
if (!Array.isArray(webpackConfigs)) {
webpackConfigs = [webpackConfigs];
}
// Convert everything to promises first to make sure we resolve all promises
const webpackConfigPromises = await Promise.all(webpackConfigs.map(webpackConfig => Promise.resolve(webpackConfig)));
// We support passing in arbitrary webpack config options that we need to merge with any read configs.
// To do this, we need to filter out the properties that aren't valid config options and then run webpack merge.
// A better long term solution here would be to have an option called webpackConfigOverrides instead of extending the configuration object.
const { config, outputStats, nodeArgs, ...restConfig } = options || ({} as WebpackTaskOptions);
exports.jest = () =>
jestTask({
...(process.env.TRAVIS && { runInBand: true }),
...(process.env.TRAVIS || argv().production ? { coverage: true } : undefined),
...(argv().u || argv().updateSnapshot ? { updateSnapshot: true } : undefined)
});
return async function addPackage() {
const args = argv();
const rootPath = findMonoRepoRootPath();
const name =
args.name ||
(await prompts({
type: 'text',
name: 'name',
message: 'What is the name of the package?'
})).name;
logger.info(`Creating a package called: ${name}`);
if (!rootPath) {
logger.warn('Cannot determine the root path to the mono repo');
return;
}
return async function addPackage() {
const args = argv();
const rootPath = findMonoRepoRootPath();
const name =
args.name ||
(await prompts({
type: 'text',
name: 'name',
message: 'What is the name of the package?'
})).name;
logger.info(`Creating a package called: ${name}`);
if (!rootPath) {
logger.warn('Cannot determine the root path to the mono repo');
return;
}
task('ts', () => {
return tscTask({
pretty: true,
...(argv().production && { inlineSources: true, sourceRoot: path.relative(libPath, srcPath) }),
target: 'es5',
outDir: 'lib',
module: 'commonjs',
});
});
task('clean', () => {