@ezbuy/ezpack
v2.2.6
Published
ezbuy fe pack tool based on webpack
Downloads
196
Readme
EZPack
基于 Webpack 的前端打包工具。
Develop
发布的时候,登陆前端的 npm 账户,执行
$ make publishPatch
Install
$ yarn add ezfepack -D
Usage
启动开发服务器
$ ezpack start
编译项目
$ ezpack build
发布项目
$ ezpack publish
// 发布上一次的模块
$ ezpack publish -l
// 发布所有的模块
$ ezpack publish -a
// 发布指定模块(aaa)
$ ezpack publish -e aaa
指定配置文件
$ ezpack start --config xxx
Configuration
工具在运行的时候,默认会读取当前目录下的 ezpack.config.js
的文件。也可以在运行的时候手动指定文件位置。下面是神盾局的配置文件例子。各个字段的说明,可以查看参数文档。
const path = require("path");
const devPort = "8101";
const srcPath = path.resolve(__dirname, "./src");
const oldPath = path.resolve(__dirname, "./src/oldErp");
const antdPath = path.resolve(__dirname, "./node_modules/antd");
module.exports = {
name: "shield",
webpack: {
rootPath: srcPath,
entry: {
index: "./src/entries/index.tsx"
},
dllEntry: {
vendors: [
// 96k
"babel-polyfill",
// 21k
"react",
// 121k
"react-dom",
// 6.8k
"redux",
// 692b
"redux-thunk",
// 51k
"react-router",
// 4.7k
"react-router-redux",
"antd",
// don't know
"classnames",
// 12K
"whatwg-fetch"
]
},
outputPath: path.resolve(__dirname, "./dist"),
devPort,
cdnPath: "/",
cssModulePath: {
include: srcPath,
exclude: [oldPath, antdPath]
},
html: true
},
publish: {
onlinePath: path.resolve(__dirname, "xxxx"),
uatPath: path.resolve(__dirname, "xxx"),
uatEnv: ["shield1", "shield2"],
jsDir: "js"
}
};