Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@epig/af-build-dev

Package Overview
Dependencies
Maintainers
2
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@epig/af-build-dev

基于af-webpack的前端构建编译工具

  • 1.0.10
  • npm
  • Socket score

Version published
Weekly downloads
3
increased by50%
Maintainers
2
Weekly downloads
 
Created
Source

af-build-dev

基于af-webpack的前端构建编译工具

usage

安装

$ npm i @epig/af-build-dev --save-dev

cli

$ epig dev # 启动开发服务器
$ epig build # 构建项目

配置项

环境变量

只列部分,详细参考af-webpack源码;

NAMENOTESDEFAULT_VALUE
PROT服务器端口8000
ANALYZEwebpack-bundle-analyzer插件开关undefined
SPEED_MEASUREspeed-measure-webpack-plugin插件开关undefined
.webpackrc.js 配置项

参考af-webpack中的webpack配置项

由于af-build-dev内建chainConfig支持,请不要配置chainConfig,其他配置项和合并到内置配置项。

内置配置项

  const webpackrc = {
    ...memo,
    publicPath: '/',
    disableDynamicImport: false,
    urlLoaderExcludes: [/\.html$/], // 避免url-loader打包html文件
    hash: isDev ? false : true,
    extraBabelPlugins: [
      [require.resolve('@babel/plugin-syntax-dynamic-import')],
      [require.resolve('babel-plugin-import'), { libraryName: 'antd', style: true }],
      [require.resolve('babel-plugin-import'), { libraryName: 'antd-mobile', style: true }, 'antd-mobile'],
      ...(memo.extraBabelPlugins || []),
    ],
  }
.epigrc.js 配置项
plugins
  • 类型:Array

数组项支持为插件名字或者自定义方法。

如果插件有参数,则通过数组的形式进行配置,第一项是插件名字,第二项是参数,类似 babel 插件的配置方式。

无参数

  plugins: [
    ['epig-plugin-admin'],
  ],

有参数

  plugins: [
    ['epig-plugin-admin', {router: true}],
  ],
chainWebpack

可支持链式配置webpack配置,参考webpack-chain

chainWebpack(config, { webpack }) {
  // 设置 alias
  config.resolve.alias.set('a', 'path/to/a');
}
 
html
  • 类型: Array | Object

参考html-webpack-plugin配置项

plugins

内置插件

const builtInPlugins = [
  'afwebpack-config',
  'epig-plugin-html',
  'epig-plugin-mock',
  'epig-plugin-copy-server',
];

afwebpack-config

epig-plugin-admin

epig-plugin-html

epig-plugin-mock

epig-plugin-copy-server

Keywords

FAQs

Package last updated on 28 Feb 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc