Half the battle in web development when adopting a new tool into your workflow is getting the damn thing set up with your current workflow. I've spent far to much time doing the install/setup song and dance in my short career, so I decided I would spend the time for you since it is my song and I want you to dance. All the build examples use the Stylus flavor of ctr
not the JavaScript flavor. If you're interested in using the JavaScript flavor of ctr
head on over to the ctr-loader docs.
All the build examples are bare-bone setups intended to get you rockin' and rollin' as fast as possible or to act as a template to help you plug ctr
in your personal build tool. Having said that, the build examples are not configured for production, although, you could easily configure them for production purposes. In addition, each build example has a README in which I give a little description, list the commands, and list the tech it employs.
The configuration of ctr
for any build tool is dead simple as long as the build tool has a Stylus plugin, loader, or adapter given that ctr
is a Stylus plugin. The following process is universal among all build tools.
- Install and set up Stylus with the build tool.
- Grunt: grunt-contrib-stylus
- Brunch: stylus-brunch
- Gulp: gulp-stylus
- Webpack: stylus-loader
- Install
ctr
. require
ctr
, and use thestylus
property to get thectr
plugin Function for Stylus. If you want you can pass the resultingctr
plugin Function an option Object, although, I recommend you use the.ctrrc
.
const ctr = require('ctr').stylus;
// plugin ctr in the "plugin" location for buildtool
// ex. plugnis: [ctr()]
- Plug-in the
ctr
plugin Function. - Profit.
Prerequisites
- Make sure you have yarn installed.
- Why
yarn
, and not whynpm
? There's a slew of reasons, but for me it's consistency. - Technically, if you want, you should be able to replace
npm
withyarn
and everything will work as expected
- Why
Install
yarn install
Install All Examples
yarn run install:all
Scripts
yarn run script:build
- Builds all the examples
yarn run script:clean
- Cleans out all the
/build
directories of examples yarn run script:clean-all
-> removes/build
and/node_modules
- Cleans out all the
yarn run script:update-check
- Checks for any
package.json
updates
- Checks for any
yarn run script:update
- Updates all
package.json
files
- Updates all
Test
yarn test
- Installs, builds, and tests all the examples
Best, te