This chapter will introduces the directory structure of output files and how to control the output directory of different types of files.
The following is a basic directory for output files. By default, the compiled files will be output in the dist directory of current project.
In production, the dist/ directory contains all the files that need to be deployed.
The most common output files are Bundle files, JS files and static assets:
[name].lynx.bundle), which can be configured with output.filename.bundle.async/[name].lynx.bundle).static/js/*.js), which can be configured with output.distPath.js and output.filename.js.static/{font,image,media,svg}) directory.In the filename, [name] is the entry name corresponding to this file, such as index, main. [hash] is the hash value generated based on the content of the file. [id] is the internal chunk ID of Rspack.
In development, an dist/.rspeedy directory is emitted which contains the resources for debugging.
In addition, Rspeedy generates some extra files in development:
.rspeedy/[name]/background.js..rspeedy/[name]/main-thread.js..map suffix.Rspeedy provides some configs to modify the directory or filename, you can:
output.filename.output.distPath.output.legalComments.output.sourceMap.Sometimes you don't want the dist directory to have too many levels, you can set the directory to an empty string to flatten the generated directory.
See the example below:
The above config produces the following directory structure: