You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constpostcss=require('postcss');constsyntax=require('postcss-syntax')({rules: [{test: /\.(?:[sx]?html?|[sx]ht|vue|ux|php)$/i,extract: 'html',},{test: /\.(?:markdown|md)$/i,extract: 'markdown',},{test: /\.(?:[cm]?[jt]sx?|es\d*|pac)$/i,extract: 'jsx',},{// custom language for file extensiontest: /\.postcss$/i,lang: 'scss'},{// custom language for file extensiontest: /\.customcss$/i,lang: 'custom'},],// custom parser for CSS (using `postcss-safe-parser`)css: 'postcss-safe-parser',// custom parser for SASS (PostCSS-compatible syntax.)sass: require('postcss-sass'),// custom parser for SCSS (by module name)scss: 'postcss-scss',// custom parser for LESS (by module path)less: './node_modules/postcss-less',// custom parser for SugarSSsugarss: require('sugarss'),// custom parser for custom languagecustom: require('postcss-custom-syntax'),});postcss(plugins).process(source,{syntax: syntax}).then(function(result){// An alias for the result.css property. Use it with syntaxes that generate non-CSS output.result.content});
About
Automatically switch PostCSS syntax based on file extensions