Skip to content

Latest commit

 

History

History

tooling-preset-web

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

tooling-preset-web

What this preset does:

  • Generate index.html and relevant assets files
  • Copy ./static/** to ./dist/**
  • CSS preprocessors (Postcss/Sass/Scss/Less/Stylus)
  • CSS extraction
  • Babel with babel-preset-latest
  • Hot reloading (Live loading fallbacks) in dev command
  • Minimize and optimize in build command
  • Auto-split vendor code and app code in build command

Install

yarn add tooling-preset-web --dev

Usage

{
  "tooling": {
    "presets": [
      "web"
    ]
  }
}

You can also use options:

{
  "tooling": {
    "presets": [
      ["web", {
        "entry": "src/index.js"
      }]
    ]
  }
}

Options

entry

Type: string
Default: index.js

Entry file.

dist

Type: string
Default: dist

Dist folder.

extract

Type: boolean
Default: true in build command

Extract CSS.

sourceMap

Type: boolean
Default: true in build command

Generate sourcemaps.

html

html-webpack-plugin options, the default value is:

{
  title: 'Tooling Preset Web: Homepage'
}

vendor

Type: boolean
Default: true in build command and only work in build command

Split vendor code and app code.