Skip to content

指令

¥Directive

Rolldown 不会为你的输出添加任何指令,以下是处理指令的策略。

¥Rolldown will not add any directive for your output, here are the strategies when handling directives.

  • output.preserveModules 禁用时,只有用户定义的入口模块中的指令会被保留。repl

    ¥When output.preserveModules is disabled, only directives in user defined entry module will be preserved repl

  • output.preserveModules 启用时,即使模块不是用户定义的入口模块,所有指令也将被保留。repl

    ¥When output.preserveModules is enabled, all directives will be preserved even the module is not user defined entry module. repl

  • 如果格式为 esm,则无论如何都会过滤掉 'use strict' 指令。repl

    ¥If the format is esm, 'use strict' directive will be filtered out whatever. repl