ezfepack
TypeScript icon, indicating that this package has built-in type declarations

1.3.10 • Public • Published

EZPack

基于 Webpack 的前端打包工具。

Develop

发布的时候,登陆前端的 npm 账户,执行

$ make publishPatch

Install

$ yarn add ezfepack -D

Usage

启动开发服务器

$ ezpack start

编译项目

$ ezpack build

发布项目

$ ezpack publish

指定配置文件

$ 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"
    }
};

Readme

Keywords

none

Package Sidebar

Install

npm i ezfepack

Weekly Downloads

22

Version

1.3.10

License

ISC

Unpacked Size

398 kB

Total Files

59

Last publish

Collaborators

  • ezbuyfe