All Projects → jaketrent → Html Webpack Template

jaketrent / Html Webpack Template

Licence: mit
a better default template for html-webpack-plugin

Labels

Projects that are alternatives of or similar to Html Webpack Template

create-fastify-app
An utility that help you to generate or add plugin to your Fastify project
Stars: ✭ 53 (-93.52%)
Mutual labels:  ejs
delet
[DEPRECATED - see README.md] a Discord bot made using Discord.js
Stars: ✭ 46 (-94.38%)
Mutual labels:  ejs
Hexo Theme Matery
A beautiful hexo blog theme with material design and responsive design.一个基于材料设计和响应式设计而成的全面、美观的Hexo主题。国内访问:http://blinkfox.com
Stars: ✭ 3,907 (+377.63%)
Mutual labels:  ejs
WordNook
Dynamically updating blogging website to upload articles and blog posts on various topics, developed using ejs template engine and node js in the backend.
Stars: ✭ 80 (-90.22%)
Mutual labels:  ejs
nestjs-mailer
🌈 A simple implementation example with and without email-templates using mailer module for nest js built on top of nodemailer.
Stars: ✭ 82 (-89.98%)
Mutual labels:  ejs
eslint-plugin-lodash-template
ESLint plugin for John Resig-style micro template, Lodash's template, Underscore's template and EJS.
Stars: ✭ 15 (-98.17%)
Mutual labels:  ejs
bot-dialogflow
A BotUI web app connected to DialogFlow
Stars: ✭ 47 (-94.25%)
Mutual labels:  ejs
Hexo Theme Anisina
🎨 A simple responsive , support qiniu image cdn theme for hexo https://haojen.github.io/
Stars: ✭ 746 (-8.8%)
Mutual labels:  ejs
Pepaverse
Pepaverse is an open source social network build with nodejs, mongoDB, passportjs and socket.io
Stars: ✭ 16 (-98.04%)
Mutual labels:  ejs
Email Templates
📫 Create, preview, and send custom email templates for Node.js. Highly configurable and supports automatic inline CSS, stylesheets, embedded images and fonts, and much more!
Stars: ✭ 3,291 (+302.32%)
Mutual labels:  ejs
equip
Gulp, EJS, Sass(ECSS), Aigis, iconfont
Stars: ✭ 33 (-95.97%)
Mutual labels:  ejs
Events-based-organizational-website
The official codebase for college-based (event managing) organizations. FOUR-LEVEL Authorization system and scalable.
Stars: ✭ 14 (-98.29%)
Mutual labels:  ejs
nodejs-simple-file-upload
a simple app for uploading files using node.js and express
Stars: ✭ 24 (-97.07%)
Mutual labels:  ejs
mini-express-boilerplate
A minimal Express boilerplate with passport user authentication, mongoose and some security setup configured
Stars: ✭ 15 (-98.17%)
Mutual labels:  ejs
Theme Bmw
✋ Smart Voice: Voice for yourself | 微声: 请为自己发声
Stars: ✭ 373 (-54.4%)
Mutual labels:  ejs
layouts
Wraps templates with layouts. Layouts can use other layouts and be nested to any depth. This can be used 100% standalone to wrap any kind of file with banners, headers or footer content. Use for markdown, HTML, handlebars views, lo-dash templates, etc. Layouts can also be vinyl files.
Stars: ✭ 28 (-96.58%)
Mutual labels:  ejs
frontplate-cli
フロントエンドビルドCLI
Stars: ✭ 25 (-96.94%)
Mutual labels:  ejs
Dynamodb Admin
GUI for DynamoDB Local or dynalite
Stars: ✭ 803 (-1.83%)
Mutual labels:  ejs
Hexo Theme Vexo
🍟 Vexo is a Hexo theme inspired by Vue's official website.
Stars: ✭ 546 (-33.25%)
Mutual labels:  ejs
Hexo Theme Huweihuang
Ported theme of Hux Blog by YuHsuan, Modified by Hu Weihuang
Stars: ✭ 266 (-67.48%)
Mutual labels:  ejs

HTML Webpack Template

Note - Support for this template is lagging Webpack. This currently only supports (old!) webpack v3. I'm looking for contributors who would like to give it some loving upgrades.

This is a template for the webpack plugin html-webpack-plugin. It has a few extra features more than the default template which will hopefully make it less likely that you'll have to create your own index.html file in your webpack project.

Templates for the html-webpack-plugin are implemented using underscore templates (previously, in 2.x, blueimp templates). You can write your own as well.

Legacy version

For the legacy version that works with [email protected], npm install [email protected].

Installation

Install the template in your project with npm:

$ npm install html-webpack-template --save-dev

Basic Usage

To make it work, you need to provide these required parameters:

  • inject: false
  • template: require('html-webpack-template')

And you can provide some other optional parameters:

  • appMountId: The <div> element id on which you plan to mount a JavaScript app.
  • appMountHtmlSnippet: A small snippet of HTML that will be inserted in the <div> element the appMountId is attached to.
  • appMountIds: An array of application element ids.
  • baseHref: Adjust the URL for relative URLs in the document (MDN).
  • devServer: Insert the webpack-dev-server hot reload script at this host:port/path; e.g., http://localhost:3000.
  • googleAnalytics.trackingId: Track usage of your site via Google Analytics.
  • googleAnalytics.pageViewOnLoad: Log a pageview event after the analytics code loads.
  • lang: String identifying your content language
  • links: Array of <link> elements.
    • If an array element is a string, the value is assigned to the href attribute and the rel attribute is set to "stylesheet";
    • If an array element is an object, the object's properties and values are used as the attribute names and values, respectively.
  • meta: Array of objects containing key value pairs to be included as meta tags.
  • mobile: Sets appropriate meta tag for page scaling.
  • inlineManifestWebpackName: For use with inline-manifest-webpack-plugin.
  • scripts: Array of external script imports to include on page.
    • If an array element is a string, the value is assigned to the src attribute and the type attribute is set to "text/javascript";
    • If an array element is an object, the object's properties and values are used as the attribute names and values, respectively.
  • window: Object that defines data you need to bootstrap a JavaScript app.
  • headHtmlSnippet: A small snippet of HTML that will be inserted in the head element.
  • bodyHtmlSnippet: A small snippet of HTML that will be inserted in the body element.

Plus any html-webpack-plugin config options otherwise available.

Example

Here's an example webpack config illustrating how to use these options in your webpack.config.js:

{
  // ...
  plugins: [
    new HtmlWebpackPlugin({
      // Required
      inject: false,
      template: require('html-webpack-template'),
      // template: 'node_modules/html-webpack-template/index.ejs',

      // Optional
      appMountId: 'app',
      appMountHtmlSnippet: '<div class="app-spinner"><i class="fa fa-spinner fa-spin fa-5x" aria-hidden="true"></i></div>',
      headHtmlSnippet: '<style>div.app-spinner {position: fixed;top:50%;left:50%;}</style >',
      bodyHtmlSnippet: '<custom-element></custom-element>',
      baseHref: 'http://example.com/awesome',
      devServer: 'http://localhost:3001',
      googleAnalytics: {
        trackingId: 'UA-XXXX-XX',
        pageViewOnLoad: true
      },
      meta: [
        {
          name: 'description',
          content: 'A better default template for html-webpack-plugin.'
        }
      ],
      mobile: true,
      lang: 'en-US',
      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'
        }
      ],
      inlineManifestWebpackName: 'webpackManifest',
      scripts: [
        'http://example.com/somescript.js',
        {
          src: '/myModule.js',
          type: 'module'
        }
      ],
      title: 'My App',
      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
    })
  ]
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].