Launch Week Day 1: Socket for Jira Is Now Available.Learn More
Socket
Book a DemoSign in
Socket

aiot-symbols-script

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aiot-symbols-script

aiot html图元脚手架

latest
npmnpm
Version
0.0.1
Version published
Maintainers
1
Created
Source

aiot-symbols-script

介绍

开发html类型图元脚手架

安装

npm install aiot-symbols-script

使用


# 开发启动
$ aiot-symbols start

# 开发构建
$ aiot-symbols build

项目配置文件说明

前端工程核心配置文件只有一个symbols.config.js下面对配置文件说明:

module.exports = () => {
    return {
        // 启动所有模块,默认这个配置,速度慢的时候使用另外的配置
        // bootList: true,

        // 启动这两个模块,不启动调试,关闭构建
        bootList: [
            "demo-app-org",
            //"demo-app-staff"
        ],
        // 代理的配置
        proxy: [
            {
                enable: true,
                headers: {
                    // 与下方url一致
                    "Referer": "http://iuap-meger-demo.test.app.yyuap.com"
                },
                //要代理访问的对方路由
                router: [
                    '/iuap'
                ],
                // pathRewrite: {
                //     '^/api/old-path': '/api/new-path', // rewrite path
                //     '^/api/remove/path': '/path' // remove base path
                // },
                url: 'http://iuap-meger-demo.test.app.yyuap.com'
            }
        ],
        // 静态托管服务
        static: 'ucf-common/src/static',
        // 是否展开静态引用资源
        res_extra: true,
        // 构建资源是否产出SourceMap
        open_source_map: true,
        // 全局环境变量
        global_env: {
            GROBAL_HTTP_CTX: JSON.stringify("/iuap_demo"),
        },
        // 别名配置
        alias: {
            //'ucf-apps': path.resolve(__dirname, 'ucf-apps/')
        },
        // 构建排除指定包
        externals: {
            //'tinper-bee': 'TinperBee'
        },
        // 调试服务需要运行的插件
        devPlugins: [],
        // 构建服务需要运行的插件
        buildPlugins: []
    }
}

功能配置节点说明

配置项说明默认值可选值备注
bootList启动、构建入口配置,true表示所有模块全部启用,数组参数按需模块使用truetrue,['app-name','app-demo']一般默认开启所有模块的调试和构建,低配置机器或者只需要开发一块模块的话可以选择性的去配置单独启动
proxy开发调试阶段的代理服务配置[]enable:true 是否有效代理,false表示关闭. headers:{} 设置代理请求的消息头. router:['/iuap','wbalone']. url:'proxy.example.com'. 本地请求代理对方服务器地址. pathRewrite:{}URL重写服务. opts:{} 如内置配置无法满足需求,需要单独设置原生配置 http-proxy-middleware.数组节点可以配置多条代理服务,通过enable来控制启用哪个,针对一些服务器校验头信息例如:Referer等就需要设置,其他常规的设置工具已经内置,代理路由router表示设置的几个路由访问后会代理到对方服务器上,url就是对方服务器地址
global_env程序内公共变量null同webpack4 { key : value }接收K、V格式如:{GROBAL_HTTP_CTX: JSON.stringify("/iuap_demo")}
alias别名null同webpack4 {key : value}接收K、V格式如:{'ucf-apps': path.resolve(__dirname, 'ucf-apps/')}
externals排除指定的包用外部变量代理提升打包性能null同webpack4 { key : value }接收K、V格式如:{'tinper-bee': 'TinperBee'}
loader内置加载器无法处理需要单独去设置处理[]同webpack4 loader
devPlugins开发环境加载的插件[]同webpack4 plugin开发阶段使用的插件
buildPlugins生产环境加载的插件[]同webpack4 plugin生产阶段使用的插件
open_source_map构建资源生产环境的时候产出sourceMaptruetrue,false-
csscss loader的optionsundefined-具体参考https://www.npmjs.com/package/css-loader
lessless loader的optionsundefined-具体参考https://www.npmjs.com/package/less-loader
res_extra是否展开静态引用资源,用于打包处理字体、图片等资源产出,或者不使用展开资源会打包到css方便管理truetrue,false-
static静态托管服务,不按需打包undefined-脚手架内的任意文件夹即可,如:static : 'ucf-common/src/static'
babel_presetsbabel使用的 presetsundefined-如:require.resolve('@babel/preset-react')
babel_pluginsbabel的插件undefined如:require.resolve("babel-plugin-import-bee")
scan_root自定义文件夹作为扫描微应用入口,原则上是按照./自定义目录/*/src/app.js扫描undefined-
dist_root输出自定义文件夹undefined-
host自定义IP、域名启动undefined支持IPV4、IPV6、域名
postcss_pluginsPostCss Pluginundefined-

自动开启浏览器

通过配置npm启动命令:

  "scripts": {
    "start": "aiot-symbols start --homepage=demo-app-org",
    "build": "aiot-symbols build"
  }

版本

  • 0.0.1 第一版本,完成start和build功能

FAQs

Package last updated on 09 Aug 2021

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