@webpackon/use-html
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

Webpackon

@webpackon/use-html

Features:

  • adds html template support (uses html-webpack-config).
  • minification html for production

Install

npm i @webpackon/use-html --save
yarn add @webpackon/use-html

API

const { useHtml } = require('@webpackon/use-html');

useHtml(params: UseHtmlParams)(config: WebpackConfig)

UseHtmlParams

export type UseHtmlParams = {
  mode: 'development' | 'production';
  title?: string;
  templatePath?: string;
};
  • mode - webpack mode

  • title - html title

  • templatePath - path for html template

Example

Full examples are here

const path = require('path');

const { compose } = require('@webpackon/core');
const { useHtml } = require('@webpackon/use-html');

module.exports = (_, { mode }) =>
  compose(
    useHtml({
      mode,
      templatePath: path.resolve(__dirname, 'public', 'index.html'),
    }),
  )({
    target: 'web',
    entry: path.resolve(__dirname, 'src', 'index.tsx'),
  });

Package Sidebar

Install

npm i @webpackon/use-html

Weekly Downloads

30

Version

1.0.1

License

MIT

Unpacked Size

4.97 kB

Total Files

7

Last publish

Collaborators

  • and_tem