Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
requireRelative.resolve('preact/compat', cwd);
compat = 'preact/compat';
} catch (e) {}
let babelConfig = Object.assign(
{ babelrc: false },
createBabelConfig(env, { browsers }),
babelrc // intentionally overwrite our settings
);
let tsconfig = resolveTsconfig(cwd, isProd);
let postcssPlugins;
try {
postcssPlugins = loadPostcssConfig.sync(cwd).plugins;
} catch (error) {
postcssPlugins = [autoprefixer({ overrideBrowserslist: browsers })];
}
return {
context: src,
resolve: {
modules: [...nodeModules, 'node_modules'],
extensions: [
'.mjs',
'.js',
'.jsx',
'.ts',
'.tsx',
'.json',
const getPostCssConfigPlugins = (directory: string) => {
try {
return postcssrc.sync({}, directory).plugins;
} catch (error) {
return [];
}
};