kyt uses a simple config file in the root of your repo for specifying different options.
To set up your config, create a kyt.config.js
file in the root of your project,
and export an object with the following options.
NOTE kyt.config.js is not currently transpiled with babel. It supports the same syntax as node 6+.
serverURL
- url for the backend node server. default: http://localhost:3000. ifhasServer
is set tofalse
, then this value is ignoredclientURL
- in development, the url for the client assets server default: http://localhost:3001debug
- when true, the CLI returns all verbose output default: falseproductionPublicPath
- the public path for assets in the production build. Useful for CDN's default:/
hasClient
- Use a client client server for dev (useful if you are using Node to generate HTML pages which are not isomorphic) default:true
hasServer
- Use a backend node server for build and dev (useful tofalse
this out if you already have a backend) default:true
modifyWebpackConfig
- Callback function for editing kyt's Webpack configs. See more details below.
In an attempt to gather feedback to set future priorities, we're running a brief user survey asking: what are you using modifyWebpackConfig
for?
modifyWebpackConfig
is an optional callback you can define to edit the Webpack config for each part of development.
This allows you to add new babel-plugins, modify Webpack loaders, etc.
The function is called with two parameters:
baseConfig
The base Webpack config used in the process.options
an object of useful options including the webpackConfig type, ports, and paths. The options object includes an environment and type so you can make changes based on a particular development task.
Define the function in your kyt.config.js
and it will be called as each Webpack file loads.
modifyWebpackConfig: (baseConfig, options) => {
// modify baseConfig based on the options
return baseConfig;
};
NOTE: Polyfills are included in the Webpack configs'
entry.main[]
array by default. If you usemodifyWebpackConfig()
to modifyentry.main[]
and you wish to keep using the provided polyfills, be sure to add the new main entries after the polyfill.
Dev Tip: webpack-merge is a helpful tool for changing and combining Webpack configs.
kyt allows developers to specify a different kyt config in dev
and build
commands for the purpose of creating environment specific configurations.
kyt build -C kyt.stage.js
option -C
or --config
takes a configuration path from the root of your project.