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

gulp-web-modules

v0.5.2

Published

Module oriented build system for single page applications

Downloads

31

Readme

gulp-web-modules

A set of gulp tasks that that make modular development of single page web applications easy.

Your a It provides:

  • build process which compiles using browserify for javascript files within defined "sections" for synchronous access with each "section" generated javascript code wrapped in AMD define functions for asynchronous "section" access.
  • a development server which serves your application and mock files but can also be plugged in for enhanced functionality
  • predefined gulp tasks to allow you to be developing your application with no setup time
  • deployment type specific configuration injection from a separate json configuation file

While these tasks do add a small amount of code to your application, it is only in the areas of javascript file modularization - no assumptions are being made about what technologies are used to actually create your application. It is basically automatically building in references to browserify when it makes sense and AMD when it makes sense.

  • browserify to modularize javascript files but allow them to be compiled to a single javascript file to reduce download overhead and provide synchronous code access
  • AMD to keep you from having to create a single artifact that will serve the whole single page application

Quick Start

Add gulp-web-modules to package.json

    "dependencies": {
      "gulp-web-modules": "*"
    }

Inject the gulp-web-module tasks with gulpfile.js

    var gulp = require('gulp'),
        gwm = require('gulp-web-modules');

    gwm({}).injectTasks(gulp);

Install the modules and run the jumpstart task

    npm install
    gulp jumpstart
    gulp watchrun

Now browse to localhost:8080

Plugins

There are many plugins can be used to enhance the build functionality. These can be seen [here](https://npmjs.org/search?q=gulpWebModulePlugin.

Project File Structure

|- config (if using gwm-config)
   |- dev.json
   |- prod.json
|- js
   |- index.js (application entry point)
   |- lib (if using gwm-lib)
      |- lib files to be prepended to application js file
|- public
   |- index.html (example file which will be copied to the build output)
|- sections (additional optional "sections" for asynchronous module loading)
  |- some-section-name
     |- index.js (section entry point - use module.exports to export section content)
     |- lib (if using gwm-config)
        |- ...
|- styles
   |- css files (others can be used with additional plugins)

For bower support, refer to the gwm-lib plugin.

Dev Server

When using gulp watch, gulp watchrun or gulp wr (shorthand for gulp watchrun), the gwm-dev-server server is executed. This can be configured using the options as shown on that page. An example is below:

    var gulp = require('gulp'),
        gwm = require('gulp-web-modules');

    gwm({
        devServer: {
            port: 8000,
            mocks: {
                prefix: '/api'
            }
        }
    }).injectTasks(gulp);