Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

webpack-plugin-purgewxss

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webpack-plugin-purgewxss

clear useless css

  • 0.0.2
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Webpack Plugin PurgeWxss

支持情况

因项目较老,暂时只考虑到Taro2.x版本,插件本身仅对编译后的WXML和对应的WXSS进行检查,故实际未与Taro产生强关联,但暂时只在Taro中尝试进行使用。

介绍

全局引入的样式会造成打包时每个样式文件都存在,但是实际很多组件和页面未使用到,故书写该插件以降低部分打包体积。

使用

 const PurgeWxssPlugin = require('webpack-plugin-purgewxss');

 // config.js
 mini: {
    postcss: {
    },
    webpackChain(chain) {
      // ...
      chain.plugin('PurgeWxssPlugin').use(PurgeWxssPlugin);
    },
 }

待解决

  • 1. 由于emit事件得到的编译后代码无法获知部分动态生成的class,类似{{anonymousState__temp}},所以暂定文件内只要存在动态class统一不做处理。(有较好的解决方案期望告知~)

Keywords

FAQs

Package last updated on 27 Jan 2023

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc