generated from rstackjs/rsbuild-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
复现步骤:
import { pluginTypeCheck } from '@rsbuild/plugin-type-check';
import { defineConfig } from '@rslib/core';
export default defineConfig({
lib: [
{
format: 'esm',
bundle: false,
shims: {
esm: {
require: true,
__filename: true,
__dirname: true,
},
},
autoExtension: false,
output: {
target: 'node',
distPath: {
root: './dist/esm',
},
filename: {
js: '[name].mjs',
},
},
},
{
format: 'cjs',
bundle: false,
autoExtension: false,
output: {
target: 'node',
distPath: {
root: './dist/cjs',
},
filename: {
js: '[name].cjs',
},
},
},
],
plugins: [
// https://github.com/rspack-contrib/rsbuild-plugin-type-check
pluginTypeCheck({
enable: true,
tsCheckerOptions: {
async: true,
formatter: { type: 'codeframe', pathType: 'absolute' },
typescript: {
typescriptPath: require.resolve('typescript'),
},
logger: {
log(message) {
console.log(message);
},
error(message: string) {
console.log(message);
},
},
},
}),
],
});const a: number = '';注意观察时间,当连续保存同一个文件的时候,一次保存将有概率导致两次输出

Metadata
Metadata
Assignees
Labels
No labels