Skip to content

Latest commit

 

History

History
56 lines (43 loc) · 1.21 KB

install.md

File metadata and controls

56 lines (43 loc) · 1.21 KB

Install 🐣

Step 1. Install the package using your favorite package manager

$ yarn add uibook

Step 2. Add Uibook in webpack.config.js

webpack.config.js

let UibookPlugin = require('uibook/plugin')

module.exports = {
  
  plugins: [
    new UibookPlugin({
      isFixedHeader: true,
      controller: path.join(__dirname, '../src/uibook-controller.js'),
      outputPath: '/uibook',
      title: 'Uibook',
      hot: true
    })
  ],
}

where:

  • controllerpath to the Uibook Controller (we’ll create it on the next step)
  • isFixedHeader (optional) — enables or disables sticky header, the default is true
  • outputPath (optional) — directory to build Uibook files, the default is uibook
  • title (optional) — Uibook title in a browser
  • hot (optional) — enable webpack-dev-server hot reload feature

⚠️ If you’re using HtmlWebpackPlugin, it’s necessary to exclude uibook:

webpack.config.js

new HtmlWebpackPlugin({
  excludeChunks: ['uibook']
})

Nice work! You’ve installed Uibook just now. Now we can configure it.


← Back to the main page

Next: Configuration →