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

af-webpack

Package Overview
Dependencies
Maintainers
1
Versions
215
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

af-webpack

webpack 类工具实现的通用部分,除 koi-core 和 koi 外,其他工具比如 tiny-cli、fengdie-cli 和 bigfish 也可基于此实现。

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.7K
increased by8.31%
Maintainers
1
Weekly downloads
 
Created
Source

af-webpack

webpack 类工具实现的通用部分,除 koi-core 和 koi 外,其他工具比如 tiny-cli、fengdie-cli 和 bigfish 也可基于此实现。

包含:

  • 封装 webpack 及其 loaders、plugins
  • 封装 webpack-dev-server

API

af-webpack/getConfig

getConfig(nodeEnv, opts);

nodeEnv 可选:

  • development
  • production

opts 包含:(cwd 必选,其他可选)

  • cwd:当前路径
  • autoprefixer:autoprefixer 配置
  • extraPostCSSPlugins:额外的 postcss 插件
  • noCompress:是否不压缩
  • babel:babel 配置

af-webpack/dev

封装了 dev 的运行。

dev({
  webpackConfig,
  appName,
  extraMiddlewares,
  beforeServer,
});

webpackConfig 必选,其他可选。

参数:

  • webpackConfig:webpack 配置
  • appName:默认是 Your Project,启动成功后的文案提示
  • extraMiddlewares:给 webpack-dev-server 的额外中间件,基于 express
  • beforeServer:server 启动前执行

af-webpack/build

封装了 build 的运行。

build({
  webpackConfig,
  success() {},
});

webpackConfig 必选,其他可选。

参数:

  • webpackConfig:webpack 配置
  • success:构建成功后执行

af-webpack/react-dev-utils

目前只有一个接口:

  • webpackHotDevClientPath:webpackHotDevClient 的真实路径,用于拼装到 entry 里开启 HMR

af-webpack/webpack

webpack 接口,可能会通过他注册一些 webpack 插件。

af-webpack/registerBabel

允许额外的文件走 babel 转化,比如配置文件。

LICENSE

MIT

FAQs

Package last updated on 23 Sep 2017

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