Skip to content

Commit

Permalink
Revert "disable postcss-calc"
Browse files Browse the repository at this point in the history
This reverts commit 87eb444.

fix: postcss/postcss-calc#111
  • Loading branch information
csr632 committed Aug 7, 2020
1 parent a8f8ff4 commit 0d8a5d0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
11 changes: 5 additions & 6 deletions scripts/build/css-var-temp-file-core.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ const fs = require('fs-extra');
const path = require('path');
const glob = require('glob');
const sass = require('node-sass');
// const postcss = require('postcss');
// const postcssCalc = require('postcss-calc');
const postcss = require('postcss');
const postcssCalc = require('postcss-calc');
// 淇濈暀鍘熺姸
const cwd = process.cwd();
const { logger } = require('../utils');
Expand Down Expand Up @@ -104,10 +104,9 @@ ${mainScssContent}`;
data: mainScss2,
});
const css = result.css.toString();
// const output = postcss()
// .use(postcssCalc())
// .process(css).css;
const output = css;
const output = postcss()
.use(postcssCalc())
.process(css).css;

fs.outputFileSync(cPath.replace('.scss', '-def-default.css').replace('core', 'core-temp'), output);
});
Expand Down
4 changes: 2 additions & 2 deletions scripts/build/generate-css-entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const path = require('path');
const glob = require('glob');
const sass = require('node-sass');
const postcss = require('postcss');
// const postcssCalc = require('postcss-calc');
const postcssCalc = require('postcss-calc');
const cssvarFallback = require('postcss-custom-properties');
const less = require('less')

Expand Down Expand Up @@ -67,7 +67,7 @@ module.exports = async function() {
const css = result.css.toString();
const output = postcss()
.use(cssvarFallback())
// .use(postcssCalc())
.use(postcssCalc())
.process(css).css;

const indexContent = output;
Expand Down
2 changes: 1 addition & 1 deletion scripts/webpack/loaders.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const css = (options = {}) => [
require('autoprefixer')({
browsers: ['last 2 versions', 'Firefox ESR', '> 1%', 'ie >= 9'],
}),
// require('postcss-calc')(),
require('postcss-calc')(),
],
},
},
Expand Down

0 comments on commit 0d8a5d0

Please sign in to comment.