All Projects → 51talk-design → freedom-middleware-webpack2

51talk-design / freedom-middleware-webpack2

Licence: MIT license
webpack2前端项目开发构建中间件,方便统一管理前端项目中95%以上的构建工作

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to freedom-middleware-webpack2

Earthly
Repeatable builds
Stars: ✭ 5,805 (+16485.71%)
Mutual labels:  build, build-tool
ukor
A Roku build tool with support for build flavors
Stars: ✭ 45 (+28.57%)
Mutual labels:  build, build-tool
Build Harness
🤖Collection of Makefiles to facilitate building Golang projects, Dockerfiles, Helm charts, and more
Stars: ✭ 236 (+574.29%)
Mutual labels:  build, build-tool
Zeus
An Electrifying Build System
Stars: ✭ 176 (+402.86%)
Mutual labels:  build, build-tool
b2
B2 makes it easy to build C++ projects, everywhere.
Stars: ✭ 38 (+8.57%)
Mutual labels:  build, build-tool
Build
B2 makes it easy to build C++ projects, everywhere.
Stars: ✭ 182 (+420%)
Mutual labels:  build, build-tool
aseprite-macos-buildsh
Automated script to create latest release app (either beta, or release whichever is newer) of Aseprite for macOS
Stars: ✭ 143 (+308.57%)
Mutual labels:  build, build-tool
Please
High-performance extensible build system for reproducible multi-language builds.
Stars: ✭ 1,856 (+5202.86%)
Mutual labels:  build, build-tool
elite
Fegeya Elitebuild, small, powerful build system. Written in Rust.
Stars: ✭ 24 (-31.43%)
Mutual labels:  build, build-tool
UnityBuildManager
Utility for running builds sequence & pushing them to markets & keeping changelog
Stars: ✭ 53 (+51.43%)
Mutual labels:  build, build-tool
Baumeister
👷 The aim of this project is to help you to build your things. From Bootstrap themes over static websites to single page applications.
Stars: ✭ 171 (+388.57%)
Mutual labels:  build, build-tool
autosetup
A better, faster autoconf replacement
Stars: ✭ 60 (+71.43%)
Mutual labels:  build, build-tool
Arduino Cmake Ng
CMake-Based framework for Arduino platforms
Stars: ✭ 123 (+251.43%)
Mutual labels:  build, build-tool
Mbt
The most flexible build tool for monorepo
Stars: ✭ 184 (+425.71%)
Mutual labels:  build, build-tool
Nginx Builder
A tool to build deb or rpm package of required Nginx version from the source code, with the ability to connect third-party modules. Nginx parameters are set in the yaml configuration file.
Stars: ✭ 123 (+251.43%)
Mutual labels:  build, build-tool
buildozer
🚜 Build tool which simplify your buildprocess. Built with Gulp.js 🥤
Stars: ✭ 22 (-37.14%)
Mutual labels:  build, build-tool
Pybuilder
Software build automation tool for Python.
Stars: ✭ 1,290 (+3585.71%)
Mutual labels:  build, build-tool
Aria2 Build Msys2
aria2 build scripts on msys2 with custom patches.
Stars: ✭ 112 (+220%)
Mutual labels:  build, build-tool
angular-build-info
🛠 A CLI to generate an easily importable `build.ts` file containing various details about the application build
Stars: ✭ 25 (-28.57%)
Mutual labels:  build, build-tool
Nginx-builder
A tool to build deb or rpm package of required Nginx version from the source code, with the ability to connect third-party modules. Nginx parameters are set in the yaml configuration file.
Stars: ✭ 143 (+308.57%)
Mutual labels:  build, build-tool

freedom-middleware-webpack2构建中间件

该中间件使用webpack2对项目进行构建,中间件统一管理了项目开发中大概95%以上的构建配置。使用该中间件对项目构建时,中间件在运行的时候会自动合并项目中的webpack.config.js(构建项目必须存在此文件)文件,然后再进行项目的构建。

npm NPM Version npm

freedom-middleware-webpack2构建中间件支持构建的项目

  • 使用less、sass、ts、vue、ejs,jade以及es6开发的项目
  • 中间件生成的webpack.config.js允许开发者根据项目需要自行扩展项目的构建配置或者覆盖中间件本身的配置
  • 中间件生成的.babelrc文件允许开发者自行定义babel相关构建配置
  • 中间件生成的tsconfig.json允许开发者自行定义ts编译选项
  • postcss.config.js允许开发者自行定义样式处理方式

freedom-middleware-webpack2安装

npm install @51npm/freedom-middleware-webpack2

freedom-middleware-webpack2构建中间件使用

var webpackBuild = require("@51npm/freedom-middleware-webpack2");
(async function () {
  var params = {
    port: 9090,
    env: "dev",//环境变量,dev:开发环境;prod:生成环境
    entryDir:"entry",//编译入口目录,位于项目/根目录/src/scripts/entry
    publicPath: `//static.xxx.com/oneTomany/0.0.1`,
    build: `build`,//生产环境prod构建的资源存放的目录,在dev环境中该值忽略
    proxy: {
      context: ["/api", "/auth","/award"],
      options: {
        target: 'http://localhost:8080'
      }
    }
  };
  await webpackBuild(params);
})();

freedom-middleware-webpack2构建中间件的参数说明

{
  "root":"",//新增参数,根目录,不写默认为process.cwd()
  "port":"本地环境dev启动的端口后",
  "env":"环境变量,dev:开发环境;prod:生成环境",
  "entryDir":"entry",//webpack编译入口目录,可选参数,此参数不传,默认查找的编译入口为entry,编译入口的目录必须位于/根目录/src/scripts/这个目录下面
  "publicPath":"构建资源的替换路径,比如:css中的图片路径",
  "build":"生产环境prod构建的资源存放的目录,在dev环境中该值忽略",
  "proxy":{ //反向代理设置
    "context":["/api", "/auth","/award"],//要拦截的url
    "options":{ //设置代理端口
      "target": 'http://localhost:8080'	
    }
  }
}

dev环境下,文件编译的目录存储于根目录下的__build目录

备注

构建项目下必须要有webpack.config.js文件,配置(webpack的配置格式)如下:

module.exports = function () {
  var extendConf = {
    plugins: [
      
    ],
    resolve: {
     
    },
    module: {
      rules: [
        
      ]
    }
  };
  return extendConf;
};

版本更新说明

发布时间 发布版本 发布功能
2020-06-16 1.0.1 修改readme
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].