Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const dir = path.dirname(filePath);
if (!fs.existsSync(dir)) {
ensureDirectoryExists(dir);
fs.mkdirSync(dir);
}
}
task('prepareBundle', () => {
ensureDirectoryExists(
path.resolve(__dirname, 'dist/win32/dev/index.win32.bundle'),
);
});
task(
'build',
series(
condition('clean', () => argv().clean),
'eslint',
'initRNLibraries',
'copyFlowFiles',
'copyPngFiles',
// native-bundle:filtered
// trickle
// react-test
'ts',
condition('apiExtractorVerify', () => argv().ci),
'apiExtractorUpdate',
'apiDocumenter',
),
);
...(argv().production && {
inlineSources: true,
}),
target: 'es6',
module: 'commonjs',
});
});
task('prepareBundle', () => {
const file = 'windows/ReactUWPTestApp/Bundle';
if (!fs.existsSync(file)) {
fs.mkdirSync(file);
}
});
task('build', series('eslint', 'ts'));
return eslintTask();
});
task('ts', () => {
return tscTask({
pretty: true,
noEmit: true,
...(argv().production && {
inlineSources: true,
sourceRoot: path.relative(libPath, srcPath),
}),
target: 'es6',
module: 'commonjs',
});
});
task('build', series('eslint', 'ts'));
task('update-api-extractor', updateApiExtractor);
task('lint-imports', lintImports);
task('prettier', prettier);
task('bundle-size-collect', bundleSizeCollect);
task('check-for-modified-files', checkForModifiedFiles);
task('generate-version-files', generateVersionFiles);
task('generate-package-manifest', generatePackageManifestTask);
task('ts', () => {
return argv().commonjs
? 'ts:commonjs-only'
: parallel('ts:commonjs', 'ts:esm', condition('ts:amd', () => argv().production && !argv().min));
});
task('validate', fs.existsSync(path.join(process.cwd(), 'jest.config.js')) ? series('tslint', 'jest') : 'tslint');
task('code-style', series('prettier', 'tslint'));
task('update-api', series('clean', 'copy', 'sass', 'ts', 'update-api-extractor'));
task('dev', series('clean', 'copy', 'sass', 'webpack-dev-server'));
task('build:node-lib', series('clean', 'copy', series(condition('validate', () => !argv().min), 'ts:commonjs-only'))).cached();
task(
'build',
series(
'clean',
'copy',
'sass',
parallel(
condition('validate', () => !argv().min),
series(
'ts',
parallel(
condition('webpack', () => !argv().min && !!resolveCwd('webpack.config.js')),
module.exports = function preset() {
basicPreset();
task('clean', clean);
task('copy', copy);
task('jest', jest);
task('jest-watch', jestWatch);
task('sass', sass);
task('postprocess:amd', postprocessAmdTask);
task('postprocess:commonjs', postprocessCommonjsTask);
task('ts:commonjs', ts.commonjs);
task('ts:esm', ts.esm);
task('ts:amd', series(ts.amd, 'postprocess:amd'));
task('tslint', tslint);
task('ts:commonjs-only', ts.commonjsOnly);
task('webpack', webpack);
task('webpack-dev-server', webpackDevServer);
task('verify-api-extractor', verifyApiExtractor);
task('update-api-extractor', updateApiExtractor);
task('lint-imports', lintImports);
task('prettier', prettier);
task('bundle-size-collect', bundleSizeCollect);
task('check-for-modified-files', checkForModifiedFiles);
task('generate-version-files', generateVersionFiles);
task('generate-package-manifest', generatePackageManifestTask);
task('ts', () => {
return argv().commonjs
? 'ts:commonjs-only'
: parallel('ts:commonjs', 'ts:esm', condition('ts:amd', () => argv().production && !argv().min));
task('ts', () => {
return argv().commonjs
? 'ts:commonjs-only'
: parallel('ts:commonjs', 'ts:esm', condition('ts:amd', () => argv().production && !argv().min));
});
task('validate', fs.existsSync(path.join(process.cwd(), 'jest.config.js')) ? series('tslint', 'jest') : 'tslint');
task('code-style', series('prettier', 'tslint'));
task('update-api', series('clean', 'copy', 'sass', 'ts', 'update-api-extractor'));
task('dev', series('clean', 'copy', 'sass', 'webpack-dev-server'));
task('build:node-lib', series('clean', 'copy', series(condition('validate', () => !argv().min), 'ts:commonjs-only'))).cached();
task(
'build',
series(
'clean',
'copy',
'sass',
parallel(
condition('validate', () => !argv().min),
series(
'ts',
parallel(
condition('webpack', () => !argv().min && !!resolveCwd('webpack.config.js')),
condition('lint-imports', () => !argv().min)
)
)
)
)
).cached();
task('validate', fs.existsSync(path.join(process.cwd(), 'jest.config.js')) ? series('tslint', 'jest') : 'tslint');
task('code-style', series('prettier', 'tslint'));
task('update-api', series('clean', 'copy', 'sass', 'ts', 'update-api-extractor'));
task('dev', series('clean', 'copy', 'sass', 'webpack-dev-server'));
task('build:node-lib', series('clean', 'copy', series(condition('validate', () => !argv().min), 'ts:commonjs-only'))).cached();
task(
'build',
series(
'clean',
'copy',
'sass',
parallel(
condition('validate', () => !argv().min),
series(
'ts',
parallel(
condition('webpack', () => !argv().min && !!resolveCwd('webpack.config.js')),
condition('lint-imports', () => !argv().min)
)
)
)
)
).cached();
task('no-op', () => {}).cached();
};
task('webpack-dev-server', webpackDevServer);
task('verify-api-extractor', verifyApiExtractor);
task('update-api-extractor', updateApiExtractor);
task('lint-imports', lintImports);
task('prettier', prettier);
task('bundle-size-collect', bundleSizeCollect);
task('check-for-modified-files', checkForModifiedFiles);
task('generate-version-files', generateVersionFiles);
task('generate-package-manifest', generatePackageManifestTask);
task('ts', () => {
return argv().commonjs
? 'ts:commonjs-only'
: parallel('ts:commonjs', 'ts:esm', condition('ts:amd', () => argv().production && !argv().min));
});
task('validate', fs.existsSync(path.join(process.cwd(), 'jest.config.js')) ? series('tslint', 'jest') : 'tslint');
task('code-style', series('prettier', 'tslint'));
task('update-api', series('clean', 'copy', 'sass', 'ts', 'update-api-extractor'));
task('dev', series('clean', 'copy', 'sass', 'webpack-dev-server'));
task('build:node-lib', series('clean', 'copy', series(condition('validate', () => !argv().min), 'ts:commonjs-only'))).cached();
task(
'build',
series(
'clean',
'copy',
'sass',
parallel(
condition('validate', () => !argv().min),
series(
'ts',