How to use the @sanity/webpack-integration/v3.getPostcssPlugins function in @sanity/webpack-integration

To help you get started, we’ve selected a few @sanity/webpack-integration 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 sanity-io / sanity / packages / @sanity / plugin-loader / loader.js View on Github external
}

    const partPath = parts.implementations[partName][0]
    return require.resolve(partPath)
  }

  // Register CSS hook
  if (options.stubCss) {
    require.extensions['.css'] = function stubCssHook(mod, filename) {
      return mod._compile(`module.exports = {} `, filename)
    }
  } else {
    const postcss = require('@sanity/webpack-integration/v3')
    cssHook({
      generateScopedName: options.generateScopedName || '[name]__[local]___[hash:base64:5]',
      prepend: postcss
        .getPostcssPlugins({basePath: basePath})
        .filter(plugin => plugin.postcssPlugin !== 'postcss-import')
    })
  }
}
github sanity-io / sanity / packages / @sanity / server / src / configs / postcss.config.js View on Github external
const resolveProjectRoot = require('@sanity/resolver').resolveProjectRoot
const webpackIntegration = require('@sanity/webpack-integration/v3')

module.exports = {
  plugins: webpackIntegration.getPostcssPlugins({
    basePath: resolveProjectRoot({sync: true}),
    cssnext: {
      features: {
        customProperties: true
      }
    }
  })
}
github sanity-io / sanity / packages / @sanity / server / src / configs / postcssPlugins.js View on Github external
export default options => {
  return webpackIntegration.getPostcssPlugins(options)
}