Serpack
Apis
Compiler Options

Compiler Options

#nodeExternal

  • Description: Excludes node_modules from the output.
  • Default: false

#externals

  • Description: Specifies modules to exclude from the output.
  • Default: []
.serpackrc.ts
export default <import('serpack').Options>{
  compilerOptions: {
    nodeExternal: false,
    externals: ['serpack'],
  },
};

#runtime

  • Description: Enables runtime functionality, which reduces output size.
  • Default: false
.serpackrc.ts
export default <import('serpack').Options>{
  compilerOptions: {
    runtime: true,
  },
};

TIP

Refer serpack/runtime.

#parserOptions

  • Description: Configuration options for the Acorn parser.
  • Default: {}

#globals

#resolverOptions

  • Description: Options for the oxc-resolver.
  • Default: {}

#type

  • Description: Specifies the type of the script, either script or module.
  • Default: "module"
  • Description: Adds a banner at the top of the output file.
  • Default: ""
  • Description: Adds a footer at the bottom of the output file.
  • Default: ""