@best-shot/preset-web

A best-shot preset for web project.

Usage no npm install needed!

<script type="module">
  import bestShotPresetWeb from 'https://cdn.skypack.dev/@best-shot/preset-web';
</script>

README

@best-shot/preset-web logo

A best-shot preset for web project.

npm github node

This preset includes the following packages:

  • micro-tpl-loader
  • html-webpack-plugin
  • webpack-subresource-integrity

Installation

npm install @best-shot/preset-web --save-dev

Usage

// example: .best-shot/config.mjs
export default {
  presets: ['web'],
  html: {
    // See: https://github.com/jantimon/html-webpack-plugin#options
  }
};

Options

// example: .best-shot/config.mjs
export default {
  presets: ['web'],
  vendors: {
    // Split Chunks
    common: ['lodash', 'axios']
  },
  html: [
    // Multiple Page Application
    {
      filename: './src/index.html',
      title: 'Hello world!'
    },
    {
      filename: './src/intro.html'
    }
  ]
};

Tips

Polyfill

This preset use global as options.babel.polyfill.

See Options in @best-shot/preset-babel

Related