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

adv-entry

v0.0.2

Published

wepack的工具模块,适用于多入口页面,提取入口entry配置和入口页面的模板

Downloads

1

Readme

简化webpack的entry配置和入口html模板的配置

webpack的entry配置一般都是{ 打包生成模块: 源模块 },有多个入口模块就得写多个键值关联对。

安装

npm install --save-dev adv-entry
或者
npm i -D adv-entry

基本用法

var entry = require("adv-entry")("src/entry/**/*.js", options)
entry.js // 自动生成webpack的entry配置
entry.html // 自动生成webpack的plugins配置中html-webpack-plugin模板,与入口js一一对应

配置参数

entry

入口js的路径。可以使用路径通配符

options

  • base:类似gulp中的base,生成的目标路径是从源路径的某一段之后开始的。
  • ext String (默认".js") 入口模块的默认后缀
  • templates Object html模板
    {  
       "入口模块": {  
          template: html模板。默认:pc.html;m:m.html——移动端  
          ext: ".html",  
          title: "",  
          output: "dist", 模板输出的路径  
          filename: 模板名称,默认和js模块的路径一致(可以包含路径,路径会作为path的下级路径)  
          inject: true,  
          chunksPath: "", 模板引用chunks自动加上路径前缀  
          chunks: 默认["manifest", "vendor", 入口模块] chunks中的"."会被替换成当前模块  
          chunksSortMode: 'dependency',  
          minify  
        }  
    }
  • template Object templates模板参数的简单版,所有模板都使用一套配置,无法给所有模板单独指定title
    {
        template
        ext: ".html",
        title
        output: "dist"
        inject
        chunksPath: ""
        chunks: chunks中的"."会被替换成当前模块
        chunksSortMode: 'dependency',
        minify
    }