So first let's understand bundle and bundleless.
A bundle is a package of build artifacts, which may be a single file or multiple files based on a certain code splitting strategy.
bundleless, on the other hand, means that each source file is compiled and built separately, but not bundled together. Each output file can be found with its corresponding source code file. The process of bundleless build can also be understood as the process of code conversion of source files only.
They have their own benefits.
bundleless is a single-file compilation mode, so for referencing and exporting types, you need to add the type
keyword. For example, import type { A } from './types'
. Please refer to TypeScript - isolatedModules for more information.
You can specify whether to bundle using the bundle option, which is set to true
by default.