1.0.2 • Published 4 years ago

@brewkit/create-brewkit v1.0.2

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago


Installation

Brewkit is highly opinionated and consists of non-transpiled source files to help with theming and improve developer UX. It is up to you and your project to handle these in the way you see fit.

If starting your project from scratch, we highly recommend you use our boilerplate.

1. Add brewkit to your project

npm install brewkit --save-dev

2. Configure Webpack

  1. Include Brewkit in your project's webpack rules for proper loader processing.

    // webpack.config.js
    
    {
        test: /\.jsx?$/,
        exclude: /node_modules\/(?!(@?brewkit)\/).*/,
        // or
        include: [
            '/app\/src/',
            '/node_modules\/brewkit/',
            '/node_modules\/@brewkit/',
        ],
        // ...
    },
  2. Add @brewkit/loader to the end of your SCSS rules.

     // webpack.config.js
    
     {
         test: /\.scss$/,
         use: ['style-loader', 'css-loader', 'sass-loader', '@brewkit/loader'],
     },

    @brewkit/loader is responsible for applying any brewkit and theme configurations to the brewkit components.

3. Import and use components as desired

import { Button } from 'brewkit';


function MyComponent() {

    // ..component stuff..

    return(
        <Button>Submit</Button>
    );
}

export default MyComponent;