Skip to content

Commit

Permalink
fix: should dynamic import publint
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjiahan committed Dec 11, 2024
1 parent c25b7d6 commit 1cdfe4b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import fs from 'node:fs/promises';
import { join } from 'node:path';
import { type RsbuildPlugin, logger } from '@rsbuild/core';
import color from 'picocolors';
import { type Options, publint } from 'publint';
import { formatMessage } from 'publint/utils';
import type { Options } from 'publint';

export type PluginPublintOptions = {
/**
Expand All @@ -20,6 +19,9 @@ export const pluginPublint = (

setup(api) {
api.onAfterBuild(async () => {
const { publint } = await import('publint');
const { formatMessage } = await import('publint/utils');

const mergedOptions = {
pkgDir: api.context.rootPath,
...options.publintOptions,
Expand Down

0 comments on commit 1cdfe4b

Please sign in to comment.