Build(deps): Bump postcss from 8.1.1 to 8.1.2 (#9443)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: fisker <lionkay@gmail.com>
This commit is contained in:
dependabot[bot]andfisker authored and GitHub committed 2020-10-23 20:44:04 +08:00
1 parent 6fbf38b55b
commit 7f9444eb21
4 files changed
+34 -20

No files matched your search

+1 -1
View File
@@ -65,7 +65,7 @@
"outdent": "0.7.1",
"parse-srcset": "ikatyang/parse-srcset#54eb9c1cb21db5c62b4d0e275d7249516df6f0ee",
"please-upgrade-node": "3.2.0",
"postcss": "8.1.1",
"postcss": "8.1.2",
"postcss-less": "3.1.4",
"postcss-media-query-parser": "0.2.3",
"postcss-scss": "3.0.2",
+27 -15
View File
@@ -56,14 +56,26 @@ const entries = [
},
];
const webpackNativeShims = (modules) => {
const shims = {};
for (const module of modules) {
const file = path.join(__dirname, `shims/${module}.mjs`);
shims[module] = fs.existsSync(file) ? file : false;
function webpackNativeShims(config, modules) {
if (!config.resolve) {
config.resolve = {};
}
return shims;
};
const { resolve } = config;
resolve.alias = resolve.alias || {};
resolve.fallback = resolve.fallback || {};
for (const module of modules) {
if (module in resolve.alias || module in resolve.fallback) {
throw new Error(`fallback/alias for "${module}" already exists.`);
}
const file = path.join(__dirname, `shims/${module}.mjs`);
if (fs.existsSync(file)) {
resolve.alias[module] = file;
} else {
resolve.fallback[module] = false;
}
}
return config;
}
function getBabelConfig(bundle) {
const config = {
@@ -256,28 +268,28 @@ function getWebpackConfig(bundle) {
output: {
path: path.resolve(root, "dist"),
filename: bundle.output,
library: ["prettierPlugins", bundle.name],
libraryTarget: "umd",
library: {
type: "umd",
name: ["prettierPlugins", bundle.name],
},
// https://github.com/webpack/webpack/issues/6642
globalObject: 'new Function("return this")()',
},
optimization: {},
resolve: {
// Webpack@5 can't resolve "postcss/lib/parser" and "postcss/lib/stringifier"" imported by `postcss-scss`
// Ignore `exports` field to fix bundle script
exportsFields: [],
fallback: webpackNativeShims(["os", "path", "util", "url"]),
},
};
if (bundle.terserOptions) {
const TerserPlugin = require("terser-webpack-plugin");
config.optimization = {
minimizer: [new TerserPlugin(bundle.terserOptions)],
};
config.optimization.minimizer = [new TerserPlugin(bundle.terserOptions)];
}
// config.optimization.minimize = false;
return config;
return webpackNativeShims(config, ["os", "path", "util", "url", "fs"]);
}
function runWebpack(config) {
+2
View File
@@ -0,0 +1,2 @@
export const existsSync = () => false;
export const readFileSync = () => "";
+4 -4
View File
@@ -5865,10 +5865,10 @@ postcss-values-parser@2.0.1:
indexes-of "^1.0.1"
uniq "^1.0.1"
postcss@8.1.1, postcss@^8.1.0:
version "8.1.1"
resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.1.1.tgz#c3a287dd10e4f6c84cb3791052b96a5d859c9389"
integrity sha512-9DGLSsjooH3kSNjTZUOt2eIj2ZTW0VI2PZ/3My+8TC7KIbH2OKwUlISfDsf63EP4aiRUt3XkEWMWvyJHvJelEg==
postcss@8.1.2, postcss@^8.1.0:
version "8.1.2"
resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.1.2.tgz#9731fcaa4f7b0bef47121821bdae9eeb609a324c"
integrity sha512-mToqEVFq8jF9TFhlIK4HhE34zknFJuNTgqtsr60vUvrWn+9TIYugCwiV1JZRxCuOrej2jjstun1bn4Bc7/1HkA==
dependencies:
colorette "^1.2.1"
line-column "^1.0.2"