New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

webpack-chunkmap-plugin

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webpack-chunkmap-plugin

生成资源映射文件的插件

latest
npmnpm
Version
0.1.2
Version published
Maintainers
1
Created
Source

webpack-chunkmap-plugin

本插件在编译完成之后,会生成一个mapping文件,来映射静态服务器的文件。配合沪江的前后端分离工作。用法想见webpack的官方文档中插件的使用说明,如:

chunkmapPlugin = require("webpack-chunkmap-plugin"),
...
plugins: [
			new chunkmapPlugin({
				serverPath: "//res.hjfile.cn/lib/editor/",
				prefix: "/st/",
				mappingFile: "mapping.json"
			})
		]

通过此插件将生成如下内容的文件

{
	"/st/editor.js":"//res.hjfile.cn/lib/editor/editor-ae82c067ab8e3b1528d4.js",
	"/st/editor.css":"//res.hjfile.cn/lib/editor/editor.css",
	"/st/test.js":"//res.hjfile.cn/lib/editor/test-ae82c067ab8e3b1528d4.js"
}

安装

hnpm install webpack-chunkmap-plugin

options

  • serverPath

    在生成的映射文件中,指定静态服务器的地址片段,将这个值和生成的文件名组合成静态服务器上的访问地址

  • prefix

    生成映射文件key的前缀,默认为空。 如上述demo中,此项值为:"/st/"

  • mappingFile

    输出的映射文件地址,基础路径为资源输出目录。

  • ignore

    过滤掉不需要生成在映射文件中的文件,该值为正则表达式。

Keywords

webpack

FAQs

Package last updated on 26 May 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts