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

rollup-plugin-monkey

v1.0.9

Published

rollup plugin for GM_Script

Downloads

5

Readme

rollup-plugin-monkey

release npm

使用 rollup 开发「GM_脚本」


git: https://github.com/wdssmq/rollup-plugin-monkey

npm: https://www.npmjs.com/package/rollup-plugin-monkey

相对不重要的外部链接

关于本项目的博文链接,以及 B 站视频演示;

「言说」写了份有点「大」的代码_杂七杂八_沉冰浮水:

https://www.wdssmq.com/post/20190704011.html

「折腾」使用 rollup.js 模块化编写 GM 脚本_电脑网络_沉冰浮水:

https://www.wdssmq.com/post/20120627834.html

「小代码」rollup.js 开发「GM_脚本」演示_哔哩哔哩_bilibili:

https://www.bilibili.com/video/BV1qe4y1d7ZM

已知问题

  • pnpm 下的正确姿势需要进一步探究;
  • @require 引入的函数库无法在开发模式下访问;

安装使用

  • 下载「初始模板」文件并解压;「点击这里下载
  • 修改文件夹名为你的项目名;
  • 进入项目文件夹后执行 cpnm i 安装依赖;「pnpm 目前还有点问题?」
  • 「userscript header」由src/__info.js定义,以字符串形式;「这是和其他同类工具最大的不同」
    • 还有一个gm_name常量建议修改为和文件夹名一样;
  • 可用命令:
    • npm run dev
    • npm run build
    • npm run clear
  • 预置了src/main.jssrc/_base.js用于实际「GM_脚本」功能编写,可自行修改或增加文件;
  • 你可以维护一份自己的「初始模板」,主要是src/__info.jssrc/_base.js
  • 本人习惯原因,正式文件会输出在项目根目录,由rollup.config.mjs内定义:
    • 可自行修改:gm_file: `${gm_name}.user.js`,gm_file: `dist/${gm_name}.user.js`,
PROJECT_SCRIPT=script_demo
# 下载初始模板
wget https://github.com/wdssmq/rollup-plugin-monkey/releases/latest/download/script_def.tar.gz
tar -xzvf script_def.tar.gz
mv script_def ${PROJECT_SCRIPT}
cd ${PROJECT_SCRIPT}
cnpm i

# 修改 src/__info.js 内常量定义

# 运行
npm run dev

doc-001.png

CSP

Edge 插件:Disable Content-Security-Policy

参考项目

| | | | ----------------------------- | ------------------------------------------------ | | lisonge/vite-plugin-monkey | https://github.com/lisonge/vite-plugin-monkey | | pearofducks/rollup-plugin-dev | https://github.com/pearofducks/rollup-plugin-dev | | thgh/rollup-plugin-livereload | https://github.com/thgh/rollup-plugin-livereload |