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

@tenp/funa

v1.0.4

Published

> 快速组件开发cli,可用于vue2/react组件开发,无需配置复杂webpack/rollup,直接运行.vue或者.tsx文件

Downloads

2

Readme

@tenp/funa 直接运行vue,react项目

快速组件开发cli,可用于vue2/react组件开发,无需配置复杂webpack/rollup,直接运行.vue或者.tsx文件

安装

$ npm i @tenp/funa -g
// 如果是mac或者linux
$ sudo npm i @tenp/funa -g

功能特征

  1. 直接运行.vue/.tsx/.ts/.js文件
  2. 基于webpack5,hot热更新等功能
  3. 支持less/scss,默认配置了less,如需scss请手动安装
  4. 支持vue jsx/tsx语法
  5. 支持mock功能
  6. 直接打包成可以用 插件
  7. 支持dev模式的ios9开发
  8. 已配置react的jsx/tsx开发,vue2的vue/tsx/jsx开发,vue3的vue/tsx/jsx开发

命令

// 启动项目
$ funa index.vue
// --name 自定义插件名字
$ funa index.vue --name ShareComponent
// --prod打包
$ funa index.vue --prod
// --out 自定义输出目录
$ funa index.vue --prod --out ./dist/vue2
// 启动react项目
$ funa index.tsx
// 不基于框架,已js模式(--vue,--react,--js)
$ funa index.ts --js

// 1.0.2版本新增命令
// 导出webpack配置
$ funa index.ts --export
// 启动vue3项目
$ funa v3.vue --vue3

mock数据

在启动文件同级创建http.mock.js,即可自动引入


module.exports = {
    "get /aaa/fec": (req,res) => {
        res.json({ code: 12641 })
    },
    "get /aaa/rrr": (req,res) => {
        res.json({ code: 14441 })
    },
    "get /cb": (req,res) => {
        res.json({ code: 1231, msg: '111' })
    }
}
// 禁止启用mock
$ funa index.vue --mock false

添加全局组件

通过全局安装的,可在任何地方直接使用

$ funa add [email protected] axios

卸载全局组件

$ funa remove [email protected] axios

自定义webpack配置

运行文件同级目录创建webpack.config.js,采用了webpack-chain,请根据webpack-chain文档进行配置

module.exports = config => {
    config.module.rules('css')
        .use('style').loader('vue-style-loader').end()
        .use('css').loader('css-loader').end()
        .use('postcss').loader('postcss-loader')
}

自定义tsconfig配置

运行文件同级目录创建tsconfig.js,

module.exports = tsconfig => {
}

导出webpack配置

$ funa index.vue --export

自定义html文件

运行文件同级目录创建index.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <%= htmlWebpackPlugin.options.cdn %>
    <title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
    当前环境<%= htmlWebpackPlugin.options.mode %>
    <div id="app"></div>
</body>
</html>