
Security News
PEP 810 Proposes Explicit Lazy Imports for Python 3.15
An opt-in lazy import keyword aims to speed up Python startups, especially CLIs, without the ecosystem-wide risks that sank PEP 690.
parcel-namer-rewrite
Advanced tools
This plugin allows to rewrite bundle file names.
To get more control over bundle file names. You may find another useful plugin - https://github.com/ol-loginov/parcel-reporter-entries to get report about actual bundle file names.
Install the package first:
npm install --save-dev parcel-namer-rewrite
And edit .parcelrc
file to add new namer (put it before or instead default one):
/* .parcelrc */
{
"extends": "@parcel/config-default",
"namers": [ "parcel-namer-rewrite" ]
}
Plugin takes all config from package.json file. Example of config is below:
{
"name": "...",
"version": "...",
"description": "",
"parcel-namer-rewrite": {
"chain": "@parcel/namer-default",
"rules": {
"styles/(.*).css": "$1.{hash}.css",
"scripts/TestMePlease.js": "Dunno.js"
}
}
}
p.s. Line with "chain" is optional, you may omit that line, and default namer will be used to get actual names
This example:
"rules" is the object with rules: "key" is RegExp pattern to search in file names, "value" is replacement strings (you may use RegExp references here)
File name "$1.{hash}.css"
adds hash before extension. If hash is empty (in development mode, for example), then you get double dot in file name:
"file.{hash}.css" -> "file..css"
But there is a solution - just put dot inside brackets. For example: "file{.hash}.css"
or "file{hash.}.css"
. In this case for empty hash strings all inside brackets will be removed. And you may use any single character instead of dot: "file{~hash}.css"
, "file{-hash}.css"
are valid replacements.
In development mode hashes are blank for file names. You may force hashing in development mode by setting "developmentHashing" to true
.
Like this:
{
"parcel-namer-rewrite": {
"developmentHashing": true,
"rules": {
/* some rules */
}
}
}
This plugin will log every renamed file. To disable this feature, add this options to package.json
:
{
"parcel-namer-rewrite": {
// ...
"silent" : true
}
}
You may want to disable the namer in development mode. To disable this feature, add this options to package.json
:
{
"parcel-namer-rewrite": {
// ...
"developmentDisable" : true
}
}
FAQs
This plugin allows to rewrite bundle file names.
The npm package parcel-namer-rewrite receives a total of 2,535 weekly downloads. As such, parcel-namer-rewrite popularity was classified as popular.
We found that parcel-namer-rewrite demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
An opt-in lazy import keyword aims to speed up Python startups, especially CLIs, without the ecosystem-wide risks that sank PEP 690.
Security News
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.