1.1.5 • Published 2 years ago

lowcode-cli v1.1.5

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

lowcode-cli Icode脚手脚

安装到全局

npm i lowcode-cli -g

脚手架提供的命令

/* 可以在终端输入:my, 打印以下内容 */

Usage: my [options] [command]

Options:
  -h, --help         display help for command

Commands:
  start [port=3001]  start run project
  build              build project
  pack               pack components
  help [command]     display help for command

脚手架的配置

/* runner.config.js */
const path = require('path');

module.exports = {
  publicPath: '/', // 子应用base路径, 默认为包名
  outputPath: './dist', // 打包文件输出地址;配置值时,基于项目根目录,默认为:'./libDist'
  lessVariables: {},
  webpackConfig: (config, options) => {
    config.resolve.alias = {
      '@resources': path.resolve(__dirname, 'src'),
      '@/utils/request': path.resolve(__dirname, 'src/utils/request'),
      '@router': path.resolve(__dirname, 'src/router'),
    };
    config.devServer.proxy = {
      '/api': {
        target: 'http://127.0.0.1:2001/',
        changeOrigin: true,
      }
    };

    config.plugins.push(
      new options.moduleFederationPlugin({
        name: 'app2',
        shared: {
          react: { singleton: true },
          'react-dom': { singleton: true },
        },
      }),
    );

    return config;
  },
};