Skip to content

Commit

Permalink
chore: Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
3y3 committed Sep 9, 2024
1 parent ae29e85 commit 62e861b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions esbuild/build.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env node

import {dirname} from 'node:path';
import {createRequire} from 'node:module';
import {build} from 'esbuild';
import {sassPlugin} from 'esbuild-sass-plugin';
import autoprefixer from 'autoprefixer';
Expand All @@ -8,6 +10,8 @@ import postcss from 'postcss';

import tsconfigJson from '../tsconfig.json' assert {type: 'json'};

const require = createRequire(import.meta.url);

/** @type {import('esbuild').BuildOptions}*/
const common = {
bundle: true,
Expand All @@ -20,6 +24,14 @@ const common = {
(async function buildCss() {
const plugins = [
sassPlugin({
importMapper: (path) => {
if (path.startsWith('@diplodoc')) {
return dirname(require.resolve(path));
}

return path;
},

async transform(source) {
const {css} = await postcss([
autoprefixer({cascade: false}),
Expand Down

0 comments on commit 62e861b

Please sign in to comment.