DefinitelyTyped/html-webpack-template/html-webpack-template-tests.ts
bumbleblym b0d3f2601e Add html-webpack-template (#13680)
* Add html-webpack-template

* Add Attributes type
2017-01-02 16:56:14 -08:00

66 lines
1.8 KiB
TypeScript

import HtmlWebpackPlugin = require('html-webpack-plugin');
import template = require('html-webpack-template');
const configs: Array<template.Config> = [
{
// Required
inject: false,
template,
// template: 'node_modules/html-webpack-template/index.ejs',
// Optional
appMountId: 'app',
appMountIds: [
'root0',
'root1',
],
baseHref: 'http://example.com/awesome',
devServer: 'http://localhost:3001',
googleAnalytics: {
trackingId: 'UA-XXXX-XX',
pageViewOnLoad: true,
},
links: [
'https://fonts.googleapis.com/css?family=Roboto',
{
href: '/apple-touch-icon.png',
rel: 'apple-touch-icon',
sizes: '180x180',
},
{
href: '/favicon-32x32.png',
rel: 'icon',
sizes: '32x32',
type: 'image/png',
},
],
meta: [
{
description: 'A better default template for html-webpack-plugin.',
},
],
mobile: true,
inlineManifestWebpackName: 'webpackManifest',
scripts: [
'http://example.com/somescript.js',
{
src: '/myModule.js',
type: 'module',
},
],
window: {
env: {
apiHost: 'http://myapi.com/api/v1',
},
},
// And any other config options from html-webpack-plugin:
// https://github.com/ampedandwired/html-webpack-plugin#configuration
title: 'My App',
},
];
const plugins: Array<HtmlWebpackPlugin> = configs.map(config =>
new HtmlWebpackPlugin(config)
);