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

free to debug in mobile phone

  • 0.1.6
  • npm
  • Socket score

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

安装

npm install @jd/jnpm -g --registry=http://registry.m.jd.com
 
jnpm i -D @jdcfe/carefree
使用
  1. webpack配置文件中引入
const Carefree = require('@jdcfe/carefree');

plugins: [
    new Carefree({
        upload: false, 
        publicPath: '//page.jd.com/exploit/360assessment_m/',
        qrcodeUrl: 'http://page.jd.com/exploit/360assessment_m/index.html',
        ftp: {
          host: '192.168.181.73',
          port: 3000,
          username: 'user',
          password: 'user',
          source: 'dist',
          target: '/var/www/html/page.jd.com/exploit/carefree-test/1.0.5'
        },
        // ssh: {
        //     host: '192.168.182.85',
        //     port: 1234,
        //     username: 'carefree',
        //     password: 'carefree',
        //     source: 'dist',
        //     target: '/carefree-test'
        // }
    })
]
  1. package.json中添加scriptscarefree-devcarefree-build可直接替换原来的devbuilduploaddevbuildupload可根据实际情况修改)
// 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. 当配置好carefree后,我们会在webpack构建后,将build后的所有静态资源增量上传至配置好的服务器上, 这样就可以不依赖wifi热点,直接在手机上访问相关页面进行调试和预览;
  4. 支持sshftp两种上传方式;
  5. upload设置为false将只打印二维码,不上传静态资源;
  6. 默认关闭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 06 Nov 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