Skip to content

Commit b5b71b8

Browse files
committed
Update post css compilations
1 parent 6f5757e commit b5b71b8

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

srcts/build/extras.ts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// This build script must be executed from the root repo directory via
22
// ```
3-
// yarn build
3+
// npm run build
44
// ```
55

66
// - TypeScript -----------------------------------------------------------
@@ -24,18 +24,22 @@ build({
2424
// - Sass -----------------------------------------------------------
2525

2626
import autoprefixer from "autoprefixer";
27-
import sassPlugin from "esbuild-plugin-sass";
28-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
29-
// @ts-ignore; Type definitions are not found. This occurs when `strict: true` in tsconfig.json
30-
import postCssPlugin from "@deanc/esbuild-plugin-postcss";
27+
import { sassPlugin } from "esbuild-sass-plugin";
28+
import postcss from "postcss";
29+
import postcssPresetEnv from "postcss-preset-env";
3130

3231
const sassOpts = {
3332
minify: true,
3433
banner: banner,
3534
plugins: [
36-
sassPlugin(),
37-
postCssPlugin({
38-
plugins: [autoprefixer],
35+
sassPlugin({
36+
async transform(source, resolveDir) {
37+
const { css } = await postcss([
38+
autoprefixer,
39+
postcssPresetEnv({ stage: 0 }),
40+
]).process(source, { from: undefined });
41+
return css;
42+
},
3943
}),
4044
],
4145
};

0 commit comments

Comments
 (0)