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 🙏

© 2025 – Pkg Stats / Ryan Hefner

webpack-multi-entry-resolve

v0.2.5

Published

webpack多入口文件处理

Downloads

28

Readme

webpack-multi-entry-resolve

webpack多入口文件处理

Getting Started

npm install webpack-multi-entry-resolve --save-dev

examples

//webpack.config.js

var $fs = require('fs');
var $path = require('path');

var $webpack = require('webpack');
var $webpackMultiEntryResolve = require('webpack-multi-entry-resolve');

var root = $path.resolve(__dirname);

var webpackConfig = {
	entry: {},
	output: {
		path: $path.join(root, 'dist'),
		publicPath: '',
		filename: 'js/[name].js',
		chunkFilename: 'js/chunk/[id].chunk.js'
	},
	module: {
		loaders: []
	},
	plugins: []
};

$webpackMultiEntryResolve(webpackConfig, {
	root: root,
	path: $path.join(root, 'entry'),
	globs: '**/*.js'
});

module.exports = webpackConfig;

options

options.debug

Type: Boolean

Default: false

是否为调试模式,开启调试模式会在控制台输出流程数据

options.root

Type: String

Default: process.cwd()

项目打包目录根路径

options.path (required)

Type: String

Default: 'entry'

项目打包入口文件夹路径

options.globs

Type: String | Array

Default: '**/*.js'

项目打包入口文件选择器,参见 walk-sync 的 globs 选项

options.global

Type: Array

Default: []

公共文件 entry 名称,会插入到 htmlWebpackPlugin.options.chunks

options.html

Type: Object

html模板文件选项,用于配置htmlWebpackPlugin

html模板文件和入口文件,其相对path的路径应该一一对应

$webpackMultiEntryResolve(webpackConfig, {
	root : root,
	path : $path.join(root, 'entry'),
	html : {
		path : $path.join(root, 'pages')
	}
});

options.html.output

Type: String

Default: 'html'

html模板的输出路径,默认为 'html'

options.html.path

Type: String

Default: ''

html模板文件所在路径

options.html.globs

Type: String

Default: '**/*.{htm,html,jade,pug,ejs,pug,handlebar,handlebars}'

用于筛选 html 模板文件

options.autoChunks

Type: Boolean

Default: true

是否自动追加 entry file 到 htmlWebpackPlugin.options.chunks

options.mock

Type: Object

配置模拟数据的选项,mock数据会被加载 htmlWebpackPlugin.options.mock

模拟文件和入口文件,其相对path的路径应该一一对应

options.mock.path

Type: String

Default: ''

模拟数据文件所在路径

options.mock.globs

Type: String

Default: '**/*.js'

用于筛选模拟数据文件

options.htmlWebpackPlugin

Type: Object

Default: {}

用于配置 htmlWebpackPlugin 的公共选项

Release History

  • 2017-04-17 v0.2.5 通过 mockjs 渲染 mock 数据
  • 2017-03-24 v0.2.4 完善默认配置
  • 2017-03-24 v0.2.3 添加选项 autoChunks
  • 2017-02-06 v0.2.2 允许配置 htmlWebpackPlugin 公共选项
  • 2017-02-04 v0.2.1 修正未能引用到外部 mock entry file 的问题
  • 2017-01-24 v0.2.0 变更选项参数名称,引入mock数据管理
  • 2016-12-13 v0.1.5 修正 windows 环境下未能正确识别html路径的问题
  • 2016-11-16 v0.1.4 引入 html.templateGlobs 选项,可配置 html 文件类型,添加项目单元测试
  • 2016-11-07 v0.1.3 引入 entryGlobs 选项,方便过滤入口文件
  • 2016-11-03 v0.1.2 支持 pug 等模板引擎
  • 2016-11-02 v0.1.1 实现与 htmlWebpackPlugin 的匹配
  • 2016-10-08 v0.1.0 发布第一个正式版