npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

remove-comment-plugin-loader

v1.0.0

Published

#### loader组件 1.初始化项目 ``` npm init -y ``` >按照提示一步步完善即可,也可使用npm init -y使用npm默认设置,稍后再通过编辑package.json修正。 注意:本次演示的包的入口文件是index.js,请务必确保package.json中字段main对应的值是“index.js” ``` index.js

Downloads

1

Readme

删除注释loader // /**

loader组件

1.初始化项目

npm init -y 

按照提示一步步完善即可,也可使用npm init -y使用npm默认设置,稍后再通过编辑package.json修正。 注意:本次演示的包的入口文件是index.js,请务必确保package.json中字段main对应的值是“index.js”

index.js

// 可以通过loader-utils这个包获取该loader的配置项options
const loaderUtils = require("loader-utils");
// 导出一个函数,source为webpack传递给loader的文件源内容
module.exports = function (source) {
  // 获取该loader的配置项
  const options = loaderUtils.getOptions(this);
  console.log("options", options);
  // 匹配js中的注释内容
  const reg = new RegExp(/(\/\/.*)|(\/\*[\s\S]*?\*\/)/g);
  // 一些转换处理,最终返回处理后的结果
  // 删除注释
  return source.replace(reg, "");
};

2.将组件发布到npm官网

npm publish

可能报的错: (1)未登录

npm ERR! code ENEEDAUTH
npm ERR! need auth auth required for publishing
npm ERR! need auth You need to authorize this machine using npm adduser

解决办法:npm adduser 输入: 用户名(忘记的话,去npm网站查看:头像 > Profile Settings) 密码 邮箱

(2)仓库地址不对

npm ERR! code E409
npm ERR! Registry returned 409 for PUT on http://r.cnpmjs.org/-/user/org.couchdb.user:yuyy: conflict

原因:通过nrm ls 命令查看我此时的仓库地址为cnpm,而不是npm npm ls 解决办法:用nrm切换到npm仓库,执行命令nrm use npm 发布成功:

3.npm install remove-comment-loader

4.github地址:https://github.com/lcyh/remove-comment-loader