Giter VIP home page Giter VIP logo

web-project-build's Introduction

About The Project

前端工程化脚手架-用于项目打包及构建等,提升研发效率,简化复杂流程。解决大前端团队底层工具链路的统一问题。

graph LR
A[大前端]--> App
App-->ReactNative,Hybrid
A--> 小程序
小程序--> WeChat,Taro,Uni-app
A--> Web
Web-->移动端
Web-->PC端
Web-->微前端
A-->组件库
组件库-->Vue
组件库-->React

脚手架提供:

  • 创建项目
  • 项目运行
  • 项目框架
  • 项目打包
  • 项目发布
  • ...

web-project-build 项目负责启动及项目打包工作。

Getting Started

Installation

  1. Install NPM packages

    npm install web-project-build -g

Usage

    web-project-build start
    web-project-build build

参数:

  • -c, --config: <自定义 config 配置文件>
  • --stop-build: 停止启动服务(用于 start 命令)
  • --custom-webpack-path: <自定义 webpack 路径>

config 文件 wpb-config.js

export default {
    // 入口文件
    entry: 'src/index.js',
    // 自定义插件
    plugins: function () {
        return [
            // 1. [插件路径,参数]
            ['.ugins/cli-build-plugin.js', { a: 1, b: 2 }],
            //2. 直接定义插件方法
            function (api, options) {
                console.log('this is anonymous plugin', options)
            }
        ]
    },
    // 自定义 Hooks 钩子
    hooks: [
        [
            'start',
            (context) => {
                console.log('start', context)
            }
        ],
        [
            'plugin',
            (context) => {
                console.log('testHook', context.webpackConfig?.toConfig())
            }
        ]
    ]
}

web-project-build's People

Contributors

betacatpro avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.