Configuring build
Quark uses webpack behind the scenes to build your project. You would configure the build process, by adding a webpack config file.Create the config file
Create a webpack.config.js file at the root of your project. e.g.
.
├─ setup.js
└─ webpack.config.js
Add webpack config
// webpack.config.js
module.exports = {
...
}
Caveats
Quark uses an in-memory file system with webpack. This requires a little patch behind the scenes. The only thing you need to remember is that:-
- The
entrykey must be an object with asrckey. - The value of this key must concat
/src/in front of the absolute file path of the file you want to be the entry point of your application.
Example: If your entry point file is index.ts at the root of your project, your config must look like this-
// .
// ├─ setup.js
// ├─ index.ts
// └─ webpack.config.js
{
...
"entry": {
"src" : "/src/index.ts"
}
}
Example: If your entry point file is index.ts nested inside of a folder (view), your config must look like this-
// .
// ├── view
// │ └── index.ts
// ├── setup.js
// └── webpack.config.js
{
...
"entry": {
"src" : "/src/view/index.ts"
}
}