momocow / webpack-userscript

A Webpack plugin for userscript projects. 🙈
https://cow.moe/webpack-userscript/
MIT License
202 stars 21 forks source link

Support entry script files filtering #66

Closed WangNianyi2001 closed 1 year ago

WangNianyi2001 commented 2 years ago

I'm working on a hack script collection where only some are Greasemonkey userscripts. I want to reuse my code between final dist version of the scripts, so I'm using webpack to handle the dist stuff. When I try to pack with this plugin, it just converts all the scripts into userscripts (ending with .user.js), regardless of whether they really is a userscript or not. image It doesn't really interfere the final result though, but I'd really like some support on non-userscript filtering.

WangNianyi2001 commented 2 years ago

Also, I noticed that this plugin is putting all the original file in an eval and overwriting them with pre-configured headers. This is ultimately unfit with my per-hack situation, since every hack script should have their own custom headers.

momocow commented 2 years ago

Sorry for late reply, I'll take a look into it.

WangNianyi2001 commented 2 years ago

啊,原来是台湾人吗,那我就用中文回复咯。 关于这个多入口点的问题,我目前的解决方案是自己写一个用来生成配置文档的脚本,构建时用 npm run 传参给它,而不直接用 npx webpack -c。 这个脚本在这里。 这个方案也不是不能用,但终归是有点麻烦,因为每次构建的时候都得手动指定一下子项目(比如 npm run pack --project=RainClass --production 这样)。 如果本插件能够直接支持就再好不过了。

inazuma-bot commented 1 year ago

:tada: This issue has been resolved in version 3.0.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: