How to use the postcss-load-config.sync function in postcss-load-config

To help you get started, we’ve selected a few postcss-load-config examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github preactjs / preact-cli / packages / cli / lib / lib / webpack / webpack-base-config.js View on Github external
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',
github mrmckeb / typescript-plugin-css-modules / src / index.ts View on Github external
const getPostCssConfigPlugins = (directory: string) => {
  try {
    return postcssrc.sync({}, directory).plugins;
  } catch (error) {
    return [];
  }
};

postcss-load-config

Autoload Config for PostCSS

MIT
Latest version published 2 days ago

Package Health Score

89 / 100
Full package analysis