Skip to content

Commit be34fbc

Browse files
committed
1 parent c7cef96 commit be34fbc

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"type": "module",
77
"scripts": {
88
"lint": "eslint lib test",
9+
"postinstall": "patch-package",
910
"test": "mocha"
1011
},
1112
"keywords": [
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
diff --git a/node_modules/@vue/component-compiler/dist/postcss-clean.js b/node_modules/@vue/component-compiler/dist/postcss-clean.js
2+
index 6944c74..957a5c5 100644
3+
--- a/node_modules/@vue/component-compiler/dist/postcss-clean.js
4+
+++ b/node_modules/@vue/component-compiler/dist/postcss-clean.js
5+
@@ -4,10 +4,16 @@ const postcss = require("postcss");
6+
// ESM import of clean-css breaks test/runtime check this fix for reference:
7+
// https://github.com/vuejs/vue-component-compiler/pull/103#issuecomment-632676899
8+
const CleanCSS = require('clean-css');
9+
-exports.default = postcss.plugin('clean', (options) => {
10+
- const clean = new CleanCSS(Object.assign({ compatibility: 'ie9' }, options));
11+
- return (css, res) => {
12+
- const output = clean.minify(css.toString());
13+
- res.root = postcss.parse(output.styles);
14+
- };
15+
-});
16+
+exports.default = (options) => {
17+
+ const clean = new CleanCSS(Object.assign({ compatibility: 'ie9' }, options));
18+
+ return (css, res) => {
19+
+ return {
20+
+ postcssPlugin: 'clean',
21+
+ Once(css, res) {
22+
+ const output = clean.minify(css.toString());
23+
+ res.root = postcss.parse(output.styles);
24+
+ },
25+
+ };
26+
+ }
27+
+};
28+
+exports.postcss = true

0 commit comments

Comments
 (0)