dojo dragon main logo

Ejecting

The Dojo build pipeline provides an end-to-end tool chain for projects, however, in rare circumstances a custom toolchain may be required. Dojo allows this to happen by ejecting a project from the build pipeline.

Ejecting is a non-reversible, one-way process that exports the underlying configuration files used by Webpack, Intern, and other projects used by dojo commands. If the provided build tools fail to provide a needed feature or functionality the recommended approach is to fork the specific build command and add the additional functionality to the tool. The Dojo CLI was specifically designed to be modular in nature with this use case in mind.

To eject a project, use the dojo eject command - it will prompt to ensure acknowledgement that the process in non-reversible. The export process puts all of the exported configuration information from all of the installed dojo commands into a new config directory. The process will also install some additional dependencies that the project now requires.

The project is now configured to be managed as a webpack project. Changes can be made to the build configuration by altering config/build-app/base.config.js.

A build can then be triggered by running webpack's build command and providing the configuration. Further, the modes are specified using webpack's env flag (e.g., --env.mode=dev), defaulting to dist.

./node_modules/.bin/webpack --config=config/build-app/ejected.config.js --env.mode=[mode]