Skip to content

Commit

Permalink
fix: buildStart hook is not async in webpack
Browse files Browse the repository at this point in the history
unplugin bug[#293](unjs/unplugin#293)
  • Loading branch information
northernCold committed Apr 29, 2024
1 parent 6b26811 commit 98fcb17
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/core/css-map/vue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ const cssShortener = new CssShortener();
const doReplacer: DoReplacer = generateReplacer((className) =>
cssShortener.shortenClassName(className)
);
export async function genCSSMap() {
const files = await fg(["**/*.{jsx,tsx,vue,html,ts,js}", "!node_modules"]);
export function genCSSMap() {
const files = fg.sync(["**/*.{jsx,tsx,vue,html,ts,js}", "!node_modules"]);
for (let file of files) {
try {
const ext = path.extname(file);
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ export const unpluginFactory: UnpluginFactory<UserOptions> = (options = {}) => {
return {
name: "unplugin-tailwindcss-shortener",
enforce: "pre",
async buildStart() {
const cssMap = await genCSSMap();
buildStart() {
const cssMap = genCSSMap();
const tailwindConfig =
options.tailwindConfig ??
path.resolve(process.cwd(), "./tailwind.config.js");
Expand Down

0 comments on commit 98fcb17

Please sign in to comment.