Skip to content

Commit

Permalink
Use new build path for PostCSS dev
Browse files Browse the repository at this point in the history
  • Loading branch information
ai committed Oct 19, 2019
1 parent 6c387e7 commit 0de6c98
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
12 changes: 6 additions & 6 deletions parsers.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,23 @@ Gonzales PE: 94 ms (5.3 times slower)
ParserLib: 96 ms (5.4 times slower)
*/

let { readFileSync, existsSync } = require('fs')
let gonzalesPe = require('gonzales-pe')
let postcssSP = require('postcss-selector-parser')
let postcssVP = require('postcss-value-parser')
let parserlib = require('parserlib')
let stylecow = require('stylecow-core')
let gonzales = require('gonzales')
let { join } = require('path')
let csstree = require('css-tree')
let postcss = require('postcss')
let rework = require('rework')
let mensch = require('mensch')
let Stylis = require('stylis')
let CSSOM = require('cssom')
let path = require('path')
let fs = require('fs')

let example = path.join(__dirname, 'cache', 'bootstrap.css')
let css = fs.readFileSync(example).toString()
let example = join(__dirname, 'cache', 'bootstrap.css')
let css = readFileSync(example).toString()

let stylis = new Stylis()

Expand Down Expand Up @@ -118,8 +118,8 @@ module.exports = {
]
}

let devPath = path.join(__dirname, '../postcss')
if (fs.existsSync(devPath)) {
let devPath = join(__dirname, '../postcss')
if (existsSync(devPath)) {
let devPostcss = require(devPath)
module.exports.tests.splice(1, 0, {
name: 'PostCSS dev',
Expand Down
14 changes: 7 additions & 7 deletions prefixers.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ Stylecow: 157 ms (4.6 times slower)
nib: 176 ms (5.1 times slower)
*/

let { existsSync, readFileSync } = require('fs')
let stylecowPrefixes = require('stylecow-plugin-prefixes')
let autoprefixer = require('autoprefixer')
let stylecow = require('stylecow-core')
let { join } = require('path')
let postcss = require('postcss')
let Stylis = require('stylis')
let stylus = require('stylus')
let path = require('path')
let fs = require('fs')

let example = path.join(__dirname, 'cache', 'bootstrap.css')
let origin = fs.readFileSync(example).toString()
let example = join(__dirname, 'cache', 'bootstrap.css')
let origin = readFileSync(example).toString()

// Autoprefixer
let css = postcss([autoprefixer({ browsers: [] })]).process(origin).css
Expand Down Expand Up @@ -86,9 +86,9 @@ module.exports = {
]
}

let devA = path.join(__dirname, '../autoprefixer/build/lib/autoprefixer.js')
let devP = path.join(__dirname, '../postcss/build/lib/postcss.js')
if (fs.existsSync(devA) && fs.existsSync(devP)) {
let devA = join(__dirname, '../autoprefixer/build/lib/autoprefixer.js')
let devP = join(__dirname, '../postcss/lib/postcss.js')
if (existsSync(devA) && existsSync(devP)) {
let devAutoprefixer = require(devA)
let devPostcss = require(devP)
let devProcessor = devPostcss([devAutoprefixer])
Expand Down
16 changes: 8 additions & 8 deletions preprocessors.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,23 @@ Dart Sass: 169 ms (4.8 times slower)
Stylecow: 199 ms (5.6 times slower)
*/

let { readFileSync, writeFileSync, existsSync } = require('fs')
let postcssSimpleVars = require('postcss-simple-vars')
let postcssNested = require('postcss-nested')
let postcssMixins = require('postcss-mixins')
let postcssCalc = require('postcss-calc')
let stylecow = require('stylecow-core')
let { join } = require('path')
let postcss = require('postcss')
let libsass = require('node-sass')
let stylus = require('stylus')
let Stylis = require('stylis')
let sass = require('sass')
let myth = require('myth')
let path = require('path')
let less = require('less')
let fs = require('fs')

let example = path.join(__dirname, 'cache', 'bootstrap.css')
let origin = fs.readFileSync(example).toString()
let example = join(__dirname, 'cache', 'bootstrap.css')
let origin = readFileSync(example).toString()
let i

let css = origin
Expand Down Expand Up @@ -87,8 +87,8 @@ for (i = 0; i < 100; i++) {
scss += 'h1 { width: 2 * $size; }'
scss += '.search { fill: black; @include icon; }'
}
let scssFile = path.join(__dirname, 'cache', 'bootstrap.preprocessors.scss')
fs.writeFileSync(scssFile, scss)
let scssFile = join(__dirname, 'cache', 'bootstrap.preprocessors.scss')
writeFileSync(scssFile, scss)

// Stylus
let styl = css
Expand Down Expand Up @@ -220,8 +220,8 @@ module.exports = {
]
}

let devPath = path.join(__dirname, '../postcss/build/lib/postcss.js')
if (fs.existsSync(devPath)) {
let devPath = join(__dirname, '../postcss/lib/postcss.js')
if (existsSync(devPath)) {
let devPostcss = require(devPath)
let devProcessor = devPostcss([
require('postcss-nested'),
Expand Down

0 comments on commit 0de6c98

Please sign in to comment.