feat: support freebsd in napi build command
This commit is contained in:
parent
b651be1bec
commit
283a4aaab9
2 changed files with 4 additions and 7 deletions
|
@ -1,17 +1,13 @@
|
||||||
import { platform } from 'os'
|
|
||||||
|
|
||||||
const platformName = platform()
|
|
||||||
|
|
||||||
const configuration = {
|
const configuration = {
|
||||||
extensions: ['ts', 'tsx'],
|
extensions: ['ts', 'tsx'],
|
||||||
files: ['test_module/__test__/**/*.spec.ts'],
|
files: ['test_module/__test__/**/*.spec.ts'],
|
||||||
require: [
|
require: [
|
||||||
platformName === 'freebsd'
|
require('os').platform() === 'freebsd'
|
||||||
? 'ts-node/register/transpile-only'
|
? 'ts-node/register/transpile-only'
|
||||||
: '@swc-node/register',
|
: '@swc-node/register',
|
||||||
],
|
],
|
||||||
environmentVariables: {
|
environmentVariables: {
|
||||||
SWC_NODE_PROJECT: './test_module/tsconfig.json',
|
TS_NODE_PROJECT: './test_module/tsconfig.json',
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,4 +15,4 @@ if (parseInt(process.versions.napi, 10) < 4) {
|
||||||
configuration.compileEnhancements = false
|
configuration.compileEnhancements = false
|
||||||
}
|
}
|
||||||
|
|
||||||
export default configuration
|
module.exports = configuration
|
|
@ -84,6 +84,7 @@ export class BuildCommand extends Command {
|
||||||
libExt = '.dll'
|
libExt = '.dll'
|
||||||
break
|
break
|
||||||
case 'linux':
|
case 'linux':
|
||||||
|
case 'freebsd':
|
||||||
dylibName = `lib${dylibName}`
|
dylibName = `lib${dylibName}`
|
||||||
libExt = '.so'
|
libExt = '.so'
|
||||||
break
|
break
|
||||||
|
|
Loading…
Reference in a new issue