1.0.1 • Published 4 years ago

parcel-plugin-patch v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

parcel-plugin-patch

对pacel打包出来的js进行全局替换,以及对该生成的js加入前后缀。

{
	"parcel-plugin-patch": {
		"replace": [{
				"regexp": "window/g",
				"replacement": "self"
			}
		],
		"prefix": "console.log('this is END START')",
		"suffix": "console.log('this is END START')"
	}
}

通过配置.parcelrcparcel-plugin-patch 配置 prefixSuffix来加入部分代码。

配置replace来进行正则替换。