npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

assemble-webpack

v3.1.2

Published

Webpack Loader + Plugin for Assemble.io handlebar compilation

Downloads

637

Readme

🔩 🛠 assemble-webpack

Webpack Loader + Plugin for compiling Handlebars using Assemble.io

Generates HTML pages using Handlebars templating and Assemble's power.

Install

npm install --save-dev assemble-webpack

Usage

const assembleWebpack = require('assemble-webpack');
const handlebarsHelpers = require('handlebars-helpers');

module.exports = {
  // webpack configurations
  module: {
    rules: [
      {
        test: /\.(hbs)$/,
        use: [
          {
            loader: 'assemble-webpack'
          }
        ]
      }
    ]
  },

  plugins: [
    new assembleWebpack.AttachedPlugin({
      baseLayout: ['./src/app/layouts/**/*.hbs'],
      basePages: ['./src/app/pages/**/*.hbs'],
      partialsLayout: ['./src/app/fe-components/**/*.hbs'],
      partialsData: [
        './src/app/fe-components/**/*.json',
        './src/app/layouts/**/*.json',
        './src/app/pages/**/*.json'
      ],
      helpers: [handlebarsHelpers(), './src/app/helpers/custom-helpers.js']
    })
  ]
};

Configuration Options & Details

| Name | Type | Description | | :------------: | ----- | -------------------------------------------------------------------------------------------------------------------------- | | baseLayout | array | Relative path of Base Layout files considered as Main template. It acts as HTML skeleton and used by the actual basePages. | | basePages | array | Relative path of Base Pages. These will generate the Actual HTML files as an output | | partialsLayout | array | Relative path of HBS partials. These are smaller re-usable components and can used inside another components or pages | | partialsData | array | Relative path of JSON data which will be interpolated in HBS components. | | helpers | array | Relative path of custom helpers files |

Important Points

  • assembleWebpack is used as a plugin to provide the required configurations and to compile handlebar files using assembler.io during Webpack build.
  • We also need assemble-webpack as a loader to compile Handlebars files with extension hbs

Note: Until you link the required resources in your project's dependency graph, Webpack will NOT be able to track it for any changes during Watch mode or while running Webpack-dev-server.

So even though assembleWebpack plugin generates the output during Webpack build, you still need to explicitly import/require the Handlebar resources somewhere in your project so that it can be re-compiled on the respective file changes.

Demo/Example

You can refer https://github.com/raviroshan/assemble-webpack-demo