mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-08 09:08:48 +01:00
eng: allow css nesting via postcss plugin (#203726)
* eng: allow css nesting via postcss plugin CSS nesting has landed in most browsers at this point, but we don't want to break users who are still stuck on old browser (mainly older iOS devices.) This PR adds a postcss plugin to the build process that de-nests nested CSS. The plugin required a newer version of postcss as well, so I have updated that and a couple other modules to their latest versions. * update build's package.json versions too
This commit is contained in:
@@ -55,11 +55,15 @@ function createCompile(src, build, emitError, transpileOnly) {
|
||||
const tsFilter = util.filter(data => /\.ts$/.test(data.path));
|
||||
const isUtf8Test = (f) => /(\/|\\)test(\/|\\).*utf8/.test(f.path);
|
||||
const isRuntimeJs = (f) => f.path.endsWith('.js') && !f.path.includes('fixtures');
|
||||
const isCSS = (f) => f.path.endsWith('.css') && !f.path.includes('fixtures');
|
||||
const noDeclarationsFilter = util.filter(data => !(/\.d\.ts$/.test(data.path)));
|
||||
const postcss = require('gulp-postcss');
|
||||
const postcssNesting = require('postcss-nesting');
|
||||
const input = es.through();
|
||||
const output = input
|
||||
.pipe(util.$if(isUtf8Test, bom())) // this is required to preserve BOM in test files that loose it otherwise
|
||||
.pipe(util.$if(!build && isRuntimeJs, util.appendOwnPathSourceURL()))
|
||||
.pipe(util.$if(isCSS, postcss([postcssNesting()])))
|
||||
.pipe(tsFilter)
|
||||
.pipe(util.loadSourcemaps())
|
||||
.pipe(compilation(token))
|
||||
|
||||
Reference in New Issue
Block a user