Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions packages/core/prebundle.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,7 @@ export default {
},
{
name: 'rslog',
afterBundle(task) {
// use the cjs bundle of rslog
fs.copyFileSync(
join(task.depPath, 'dist/index.cjs'),
join(task.distPath, 'index.js'),
);
},
dtsOnly: true,
},
{
name: 'launch-editor-middleware',
Expand Down
3 changes: 2 additions & 1 deletion packages/core/rslib.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ export default defineConfig({
// Only use tsgo in local dev for faster build, disable it in CI until it's more stable
tsgo: !process.env.CI,
alias: {
// alias to pre-bundled types as it's public API
// alias to pre-bundled types as they are public API
rslog: './compiled/rslog',
'rspack-chain': './compiled/rspack-chain/types',
},
},
Expand Down
1 change: 0 additions & 1 deletion packages/core/src/helpers/vendors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ type CompiledPackages = {
ws: typeof import('../../compiled/ws').default;
cors: typeof import('../../compiled/cors').default;
sirv: typeof import('../../compiled/sirv');
rslog: typeof import('../../compiled/rslog');
memfs: typeof import('../../compiled/memfs');
mrmime: typeof import('../../compiled/mrmime');
connect: typeof import('../../compiled/connect').default;
Expand Down
6 changes: 2 additions & 4 deletions packages/core/src/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@
* This convention helps distinguish between normal operations
* and important alerts that require attention.
*/
import type { Logger } from '../compiled/rslog/index.js';
import { color, requireCompiledPackage } from './helpers/vendors';

const logger: Logger = requireCompiledPackage('rslog').logger;
import { type Logger, logger } from 'rslog';
import { color } from './helpers/vendors';

export const isDebug = (): boolean => {
if (!process.env.DEBUG) {
Expand Down
Loading