Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@nutui/carefree

Package Overview
Dependencies
Maintainers
2
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nutui/carefree

A H5 debugging tool independent of wifi hotspots

  • 0.4.0
  • npm
  • Socket score

Version published
Weekly downloads
7
increased by600%
Maintainers
2
Weekly downloads
 
Created
Source

本webpack插件功能:

  1. 处理静态资源路径,并以watch mode编译
  2. 将编译后的文件自动上传到指定服务器指定目录
  3. 在终端打印出页面入口地址并生成二维码,供手机扫描访问
  4. 监听模式下,一旦保存修改,将自动增量编译
  5. 有变化的文件会被自动增量上传到服务器
  6. 手机刷新页面或再次扫码即可

安装

npm install @nutui/carefree --save-dev

使用

  1. webpack配置文件中引入
const Carefree = require('@nutui/carefree');

plugins: [
    new Carefree({
        //配置项
    })
]
  1. package.jsonscripts字段中添加carefree-devcarefree-build命令
// package.json
scripts: {
    ...
    "carefree-dev": "cross-env NODE_ENV=carefree carefree_env=dev webpack -w --colors --progress",
    "carefree-build": "cross-env carefree_env=build npm run upload",
    ...
}
  1. 如果想在启用脚本时暂时不使用carefree,可在脚本里修改carefree_envcross-env carefree_env=stop
  2. 命令行将会打印出二维码,推荐命令行终端的主题为暗黑系
  3. 目前支持sshftp两种上传方式
  4. upload设置为false将只打印二维码,不上传静态资源
  5. 默认关闭devtool以减小上传文件的体积,需要时可以设置为webpackdevtool相应值

Carefree参数说明

参数说明默认值是否必填
upload是否上传true
devtool参考webpack的devtool配置false
publicPath同webpackConfig.output.publicPath-
qrcodeUrl扫二维码后跳转的地址publicPath + 'index.html'
ftp.host服务器ip--
ftp.port服务器--
ftp.source待上传的目录--
ftp.target服务器端的项目目录--
ftp.username服务器用户名--
ftp.password服务器密码--
ssh[option]同ftp相关配置项--

Keywords

FAQs

Package last updated on 20 Dec 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc