> For the complete documentation index, see [llms.txt](https://coldbox-elixir.ortusbooks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://coldbox-elixir.ortusbooks.com/running_elixir.md).

# Running Elixir

Elixir is built on top of Webpack, so to run your Elixir tasks you only need to run the `webpack` command in your terminal. Before running Webpack, you will need a `webpack.config.js` file in the root of your project. Below is a simple example:

```javascript
const elixir = require("coldbox-elixir");

module.exports = elixir(mix => {
    mix.js("app.js");
});
```

Please note that by adding the `-p` flag to the command will turn on Webpack's production mode. This will minify your CSS and JavaScript files as well as add long-term caching hashes to your compiled files.

## Watching Assets For Changes

For performance and convienence, you can run Webpack in watch mode by passing the `-w` or `--watch` flag. Any changes to your source files will automatically re-run your build. Note that your build will be significantly faster on subsequent changes than when running Webpack from scratch.

## NPM Scripts

The easiest way to run Webpack is to set up some NPM scripts. Here are the following we recommend:

```javascript
"scripts": {
    "dev": "webpack --hide-modules",
    "watch": "npm run dev -- --watch",
    "prod": "npm run dev -- -p"
}
```

Then from the terminal you can run `npm run [scriptName for this example either dev, watch or prod]` to run the associated script.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://coldbox-elixir.ortusbooks.com/running_elixir.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
