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

@codeages/webpack-vue3

v1.5.0

Published

基于webpack的多入口构建方案

Downloads

78

Readme

package.json

对无关配置进行了省略

{
    "scripts": {
        "serve": "cross-env NODE_ENV=development nodemon --max_old_space_size=4096 node_modules/@codeages/webpack-vue3/dist/webpack.dev.js",
        "build": "node --max_old_space_size=4096 node_modules/@codeages/webpack-vue3/dist/webpack.prod.js",
    }
}

实时编译

实体编译,用于开发模式下,在对前端模块代码修改后,能实时编译生效。

启动实时编译服务:

npm run serve

启动服务后,默认会在本地启动3002端口的前端模块实时编译服务。

编译实体文件

编译实体文体:

npm run build

常见错误

模块不存在

错误提示:

ERROR in multi ....
    Module not found: Error: Cannot resolve 'file' or 'directory' 

解决办法:

rm -rf node_modules
yarn

app crashed

错误提示:

[nodemon] app crashed - waiting for file changes before starting...

解决办法:

在控制台(终端)里输入rs,然后回车。

内存泄漏

错误提示:

<--- Last few GCs --->

      14 ms: Mark-sweep 2.2 (37.1) -> 2.1 (38.1) MB, 2.8 / 0 ms [allocation failure] [GC in old space requested].
      15 ms: Mark-sweep 2.1 (38.1) -> 2.1 (39.1) MB, 1.2 / 0 ms [allocation failure] [GC in old space requested].
      16 ms: Mark-sweep 2.1 (39.1) -> 2.1 (39.1) MB, 0.9 / 0 ms [last resort gc].
      17 ms: Mark-sweep 2.1 (39.1) -> 2.1 (39.1) MB, 1.0 / 0 ms [last resort gc].
...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory

解决办法:

重新执行命令:npm run devnpm run compile

端口被占用

events.js:154
      throw er; // Unhandled 'error' event
      ^

Error: listen EADDRINUSE 0.0.0.0:3002
    at Object.exports._errnoException (util.js:893:11)
    at exports._exceptionWithHostPort (util.js:916:20)
    at Server.__dirname.Server.Server._listen2 (net.js:1246:14)
    ....

解决方法:该错误表明你已经开启了一个端口号为3030的服务,需要先把那个服务关掉。

lsof -i:3002
kill -9 xxxxx(PID编号)

系统默认最大文件打开数过少

报错信息:

watch ...  ENOSPC

解决方法: 在控制台输入

echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p