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

map-webpack-plugin

v1.1.3

Published

webpack map plugin

Downloads

11

Readme

map-webpack-plugin

安装 Install

npm install map-webpack-plugin

日志 Log

  • 1.1.3 增加webpack3的兼容测试,已完美兼容webpack3。
  • 1.1.1,1.1.2 增加webpack2的兼容测试,已完美兼容webpack2。
  • 1.1.0 增加文件的合并功能,当merge为文件路径时,则合并提供的文件。
  • 1.0.1 增加.npmignore 文件,忽略测试文件,减小安装包的容量。
  • 1.0.0 增加测试用例,多方测试后,升级为稳定版1.0.0
  • 0.3.0 增加文件过滤
  • 0.2.2 增加默认的字体规则
  • 0.2.1 增加了合并原来文件的json数据,前提是json数据没有错误(比如:文件版本冲突未解决)。

配置 Usage

var MapPlugin = require('map-webpack-plugin');
var mapPluginInstance = new MapPlugin({
    filename:'map.json',//输出的文件名 即保存的文件
    path: './',//输出的目录 即保存的路径
    rule: { //定义输出的类型,非必填项
        font: /\.woff$/i
    },
    filter: ['.action'],//过滤文件类型
    merge: true //跟文件的json数据进行合并 两种情况,如果是true or false 则表示是否合并配置中的filename文件,如果是string类型,则需要是一个文件的路径(此文件必须是json文件,并且没有语法错误),这个时候会合并提供的这个文件,比如:path.join(__dirname, './core.json')
});


module.exports = {
  ...
  plugins: [
    mapPluginInstance
  ]
};

输出的文件 Output

{
    "js":{
        "js/a.js":"js/a.3efdr5.js"
    },
    "css":{
        "css/a.css":"css/a.3efdr5.css"
    },
    "img":{
        "img/err.png":"img/err.6sfetg.png"
    },
    "font":{
        "fonts/iconfont.woff": "fonts/iconfont.35c9d1.woff"
    }
    "other":{}
}