Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
extract-css-didi
Advanced tools
Extract the same css to common place to reduce the duplicate codes, and reduce package size. Sort css properties to reduce reflow and repaint, for improving the performance of page render
Extract the same css to common place to reduce the duplicate codes, and reduce package size
Sort css properties to reduce reflow and repaint, for improving the performance of page render
npm install extract-css-didi
Add script in package.json, as follows:
// package.json
"scripts": {
"css": "extract-css s"
}
Now you can run the script
npm run css
There are some configurations that you can customize if the default configuration doesn't meet your demands.
Create new file named extract.css.json in the root directory of your project,
// extract.css.json
// default configurations
{
"entry": "src/main.js",
"destPath": "src/assets/css/common.less",
"insertInfos": {
"insertFile": "src/main.js",
"insertContent": "import './assets/css/common.less'"
},
"logOutPut": "logs"
}
entry -> [filePath|Array<filePath>
], the entry of collecting the style files.
destPath -> [filePath], the destPath tell extract-css-didi where to put the extracted style.
insertInfos -> [Object], contain the infos where to import the destPath file.
insertFile -> [filePath], which file will import the destPath file.
insertContent -> [String], the insertContent will be put in the insertFile, default be appended to the bottom of insertFile.
insertPosition -> [String], as a position flag, can be used to custom place where insertContent inserted.
logOutPut -> [dirPath], the directory of logs, when common css is extracted, will generate log file.
sortFile -> [filePath], sort css properties for single file. you can excute script as follows to get same effect.
extract-css s sort <filePath>
extract-css s sort
NOTE: When config the sortFiles or sortFile, the extract-css-didi will not extract common css between the different files.
FAQs
Extract the same css to common place to reduce the duplicate codes, and reduce package size. Sort css properties to reduce reflow and repaint, for improving the performance of page render
We found that extract-css-didi demonstrated a not healthy version release cadence and project activity because the last version was released 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
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.