@polight/lego
Version:
Tiny Web Components lib for future-proof HTML mentors
35 lines (21 loc) • 1.52 kB
Markdown
---
title: Configuring
weight: 6
---
[]({{< relref "compiling" >}}) can take several parameters: `sourceDir`, `targetDir`, `watch`…
These will allow you to fine grain your configuration when compiling.
The full list of parameters is available in the [compiler config](https://github.com/Polight/lego/blob/master/src/compiler/config.js#L1). You should check that file to know the exhaustive list of parameters and what they do.
You can either setup each of these values from a custom config file or directly from the command line arguments.
Create a **lego.config.js** file at the root of your project with the following:
```js
export default {
// Your custom settings here
}
```
This file will override the default [**config.js**](https://github.com/Polight/lego/blob/master/src/compiler/config.js#L1) settings when declared.
> If your **lego.config.js** file is not found, please ensure to have `"type": "module"` in your **package.json** file in order to read `.js` files as modules.
If reading in the console `⚠️ Missing lego.config.js file, building with defaults`, it means the **lego.config.js** was not found in the root folder of the project from where the compiler is called.
It's very fine if you don't need to customize configuration and run with defaults.
[]({{< relref "compiling" >}}) will override default parameters and custom configuration.