# 脚本打包 - esbuild

# scripts.entry

scripts.entry: string | string[] = ''

esbuild 入口配置快捷方式。

🌰 举个栗子:

module.exports = {
  scripts: {
    bundler: 'esbuild',
    entry: ['./app/scripts/main-page.js', './app/scripts/sub-page.js']
  }
  // 其他配置项...
};

# scripts.buildOptions

scripts.buildOptions: BuildOptions = {}

Build 配置 (opens new window)

# scripts.useTransform

scripts.useTransform: boolean = false

启用自定义转换文件。

# scripts.transformOptions

scripts.transformOptions: TransformOptions = {}

Transform 配置 (opens new window)

🌰 举个栗子:

module.exports = {
  scripts: {
    bundler: 'esbuild',
    entry: ['./app/scripts/react-entry.js'],
    useTransform: true,
    transformOptions: {
      loader: 'jsx'
    }
  }
  // Other Options...
};
Last Updated: a year ago