@qse/common-utils
v1.3.47
Published
react工程的工具类
Downloads
5
Readme
CommonUtils
react工程的工具类
安装使用
通过 npm 安装
common-utils 可以通过 npm 安装到项目中, 先变更注册为私库(npm config set registry http://192.168.10.162:8081/nexus/content/groups/npm-all/
)
npm install common-utils --save
通过 CDN 引用
common-utils 可以通过 CDN 引入到项目中。
- 引入指定版本。用版本号替换
[version]
部分的内容即可: https://xxx/utils[version].min.js
config 工具使用
路由分工程使用
api分工程使用
私库操作
1. npm变更为私库
npm config set registry http://192.168.10.162:8081/nexus/content/groups/npm-all/ 淘宝的: npm config set registry https://registry.npm.taobao.org/
2. npm发布私库
(1) 配置.npmrc文件 [email protected] always-auth=true _auth=YWRtaW46YWRtaW4xMjM=
_auth 的值 在任意目录下创建一个in.txt文件,里面直接写nexus访问的用户名:密码。 如:admin:admin123 不要有空行或空格等其他信息。 在in.txt目录下命令行执行 certutil /encode in.txt out.txt 执行后会在当前目录生成out.txt文件,内容是 —–BEGIN CERTIFICATE—– YWRtaW46YWRtaW4xMjM= —–END CERTIFICATE—– 第二行即为编码证书,把这串证书信息及你的邮箱信息添加到 .npmrc中:
作者:王淑君_8f58 链接:https://www.jianshu.com/p/7930b3e07ef5 来源:简书 简书著作权归作者所有,任何形式的转载都请联系作者获得授权并注明出处。
(2) 发布 npm publish --registry http://192.168.10.162:8081/nexus/content/repositories/npm-private/
nowa参数
[ '-s, --src <dir>', 'source directory, default to `src`', 'src' ],
[ '-d, --dist <dir>', 'build directory, default to `dist`', 'dist' ],
[ '-e --entry <file>', 'app entry, default to `app/app.js`', 'app/app.js' ],
[ ' --pages [pages]', 'add multi-page entries' ],
[ ' --buildvars <json>', 'build varibles' ],
[ ' --vars <json>', 'runtime varibles' ],
[ ' --externals', 'webpack external varibles' ],
[ '-o, --loose', 'use babel es2015 loose mode to transform codes' ],
[ '-c, --keepconsole', 'keep `console.log`' ],
[ ' --keepcss', 'keep non-extracted css in all builds'],
[ ' --skipminify', 'skip minify js and css' ],
[ '-p, --progress', 'show progress' ],
[ ' --exportcss', 'export css files' ],
[ ' --multiCompilers', 'generate multi-compilers' ],
[ ' --minifyExtension <extension>', 'minify file extension' ],
[ ' --includes', 'loader should include paths' ],
[ ' --polyfill', 'use core-js to do polyfills' ],
[ ' --mangle', 'mangle varibles when minify' ],
[ ' --alias', 'path alias' ],
[ ' --publicPath <path>', 'set publicPath in webpack'],
[ ' --analyse [port]', 'analyse bundle size'],