Skip to content
Merged
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
6 changes: 6 additions & 0 deletions .changeset/evil-dolls-tell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'harmonix': patch
'@harmonix-js/cli': patch
---

Fix build entry resolving error
1 change: 0 additions & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
"pkg-types": "^2.3.0",
"pretty-bytes": "^6.1.1",
"rollup": "^4.52.5",
"rollup-plugin-esbuild": "^6.2.1",
"scule": "^1.3.0",
"std-env": "^3.10.0",
"tinyexec": "^1.0.1",
Expand Down
18 changes: 8 additions & 10 deletions packages/cli/src/commands/build/config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { builtinModules } from 'node:module'
import { sanitizeFilePath } from 'mlly'
import { dirname, normalize, relative, resolve } from 'pathe'
import { dirname, normalize, relative } from 'pathe'
import { nodeResolve } from '@rollup/plugin-node-resolve'
import esbuild from 'rollup-plugin-esbuild'
import commonjs from '@rollup/plugin-commonjs'
import json from '@rollup/plugin-json'

Expand All @@ -17,15 +17,15 @@ export const getRollupConfig = (
rootDir: string
): RollupOptions => {
return {
input: resolveEntry('../runtime/harmonix.mjs', import.meta.url),
external: ['discord.js'],
input: resolveEntry('./runtime/harmonix.mjs', import.meta.url),
external: [
'discord.js',
...builtinModules,
...builtinModules.map((m) => `node:${m}`)
],
plugins: [
config(harmonix.options),
modules(harmonix),
esbuild({
target: 'es2022',
platform: 'node'
}),
nodeResolve({
preferBuiltins: true,
rootDir,
Expand Down Expand Up @@ -70,10 +70,8 @@ export const getRollupConfig = (
},
format: 'esm',
exports: 'auto',
generatedCode: { constBindings: true },
sanitizeFileName: sanitizeFilePath,
sourcemap: harmonix.options.sourceMap,
sourcemapExcludeSources: true,
sourcemapIgnoreList: (p) => p.includes('node_modules')
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/harmonix/src/pipeline.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CommandInteraction } from 'discord.js'
import type { CommandInteraction } from 'discord.js'

import type { Middleware } from './types/runtime/pipeline'

Expand Down
Loading