Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
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')
})
}
}
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
}
}
})
}
export default options => {
return webpackIntegration.getPostcssPlugins(options)
}