Build Config
Treats Build config are used to configure Treats at compile & bundle time, you can supply these configuration by providing treats.config.js on your project directory. If you use create-treats-app, the default had already been configured for you:
//treats.config.js
const path = require("path");
const config = {
app: {
name: "my-treats-app",
slug: "my-treats-app"
},
alias: {
"@page": path.resolve(__dirname, "./src/page")
}
};
module.exports = config;
There's several configuration that could be setup here:
app- App meta related configuration, this config would be supplied to Treats generator when it is used.namename of the appslugof the app
alias- You could register alias on your project here.build- This configuration would be used to configure your buildgraphql- if value isfalsegraphql client codes won't be included on your build.redux- if value isfalseredux codes won't be included on your build.
webpack- This configuration can be used to extends Treats webpack setuppublicPath- This value would override publicPath definition for your asset files.client- This value would be merged to Treats client Webpack configuration using webpack-mergeserver- This value would be merged to Treats server Webpack configuration using webpack-mergeworkbox- This configuration can be used to enable and setting workbox configuration in treats. More info on workbox configuration can be seen on here
postcss-This configuration can be used to extends Treats PostCSS setupbabel-This configuration can be used to extends Treats Babel setup. All values would be merged to treats babel config using babel-merge
