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

multi-entry-webpack-starter

v1.3.3

Published

a webpack starter for multi page applications

Downloads

13

Readme

multi-entry-webpack-starter

make multi-page webapps easy to start with webpack

Guide

Setup

  1. Setup your package.json, see examples/package.json
  2. Setup your parameters.js, see examples/parameters.js

Example of Symfony2 webapp

structure

project
|-app
|  |-Resources
|  |  |-assets
|  |  |  |-common
|  |  |  |  |-script.js
|  |  |  |-config
|  |  |  |  |-parameters.js
|  |  |  |-libs
|  |  |  |  |-jquery-plugins
|  |  |  |  |-less
|  |  |  |  |-js
|  |  |  |  |-vendor.js
|  |  |  |  |-vendor.less
|-src
|  |-AppBundle/Resources/assets
|  |  |-js
|  |  |  |-app
|  |  |  |  |-user
|  |  |  |  |  |-index.js
|  |  |-app.js
|-web
|  |-static
|  |  |-libs
|  |  |  |-jquery-validation
|  |  |  |-vendor.js
|  |  |  |-vendor.css

parameters.js

/**
 * This file is a template of what your parameters.js file should look like.
 * This file is also a example for symfony2 apps, put it into app/Resources/assets/config/parameters.js.
 */

const parameters = {
  paths: {
    globalAssets: 'app/Resources/assets/', //global assets dir
    libs: 'app/Resources/assets/libs/',
    output: 'web/static/', //webpack file output path
    publicPath: '/static/', //relative to website domain
  },
  bundlesEntry: { //register entry and its chunks
    app: {
      entry: 'src/AppBundle/Resources/assets/app.js',
      chunksPath: 'src/AppBundle/Resources/assets/js/app/',
    },
    admin: {
      entry: 'src/AppBundle/Resources/assets/admin.js',
      chunksPath: 'src/AppBundle/Resources/assets/js/admin/',
    },
    other: {
      entry: 'src/OtherBundle/Resources/assets/other.js',
      chunksPath: 'src/OtherBundle/Resources/assets/js/other/',
      chunksFilter: '/*/index.{js,jsx}',
    },
  },
  libs: { // path realtive to globalAssets path, each lib will be compiled into a single file named with the key, like `web/static/libs/vendor.js`, `web/static/libs/fix-ie.js`, and echo lib file must use <scripts src=``web/static/libs/xxx.js`> in the page. This is designed for reducing js contents in each page.
    vendor: ['vendor.js'], //can be a js file
    ckeditor: ['ckeditor'], //or can be a node module name
    'fix-ie': ['html5shiv', 'respond-js'],
    'jquery-validation': ['js/jquery-validation.js'],
    'jquery-form': ['jquery-form'],
    'jquery-treegrid': ['jquery-plugins/jquery-treegrid/jquery-treegrid.js'],
  },
  noParseDeps: [ //These node modules will use a dist version to speed up compilation.
    'jquery/dist/jquery.js',
    'bootstrap/dist/js/bootstrap.js',
    'admin-lte/dist/js/app.js',
    'jquery-validation/dist/jquery.validate.js',
    'jquery-form/jquery.form.js',
    'bootstrap-notify/bootstrap-notify.js',
    // The `.` will auto be replaced to `-` for compatibility 
    'respond.js/dest/respond.src.js',
  ],
  pureCopy: [ //pure copy from node_modules to libs output dir
    {
      from: 'ckeditor', //relative to node_modules
      to: 'ckeditor', //relative to libs output dir
      ignore: [
        'samples/**',
        'lang/!(zh-cn.js)',
        '.github/**',
        'adapters/**',
        '.npminstall.done',
        '*.md',
        '*.json',
      ]
    },
    {
      from: 'weui.js/dist/weui.min.js',
      to: 'weui.js',
    },
  ],
};

export default parameters;

Easy Usage

during develop

npm run dev
npm run dev port:3038 #change port

compile output

npm run compile
npm run compile:debug