@lugia/mega-webpack
对
webpack
的包装,零配置使用
@lugia/mega-webpack
based on - @lugia/mega-scripts
API
mega-webpack/getConfig
通过参数获取 webpack 配置
在开发或者构建时使用,会获取预设的配置,包含构建 react 技术栈应用的所有 loader 和 plugin
import { getConfig } from '@lugia/mega-webpack';
const webpackConfig = getConfig(options);
mega-webpack/dev
启动服务,开发
import { dev } from '@lugia/mega-webpack';
dev({
webpackConfig,
beforeServer,
afterServer,
proxy,
...otherConfig
});
mega-webpack/build
打包构建
import { build } from '@lugia/mega-webpack';
build({
webpackConfig,
success,
...otherConfig
});
mega-webpack/webpack
import webpack from '@lugia/mega-webpack';