@0y0/webpack-config-react 中文文档教程

发布于 3年前 浏览 30 项目主页 更新于 3年前

@0y0/webpack-config-react · GitHub licensenpm

@0y0/webpack-config-react 是 React 的常见 webpack 配置。

Installation

npm install @0y0/webpack-config-react --save-dev

Usage

const createWebpackConfig = require('@0y0/webpack-config-react')
const webpackConfig = createWebpackConfig(options)

Options

NameTypeDefaultDescription
isDevbooleantrueWhether or not development environment
appNamestring (required)Application name
rootDirstring (required)Project directory
srcDirstring{rootDir}/srcSource directory
distDirstring{rootDir}/distDistribution directory
staticDirstring{rootDir}/src/staticStatic directory
jsChunksobject{ app: '{rootDir}/src/index.js' }JS entries
htmlChunksobject{ app: '{rootDir}/src/index.html' }HTML entries
publicPathstring/Public path
assetPathstring/Asset path
serviceWorkerPathstring/sw.jsService worker path
resolveAliasobjectModule aliases. See webpack doc for details
chunkGroupsobjectCache groups config of split chunk plugin. See webpack doc for details
variablesobject{}Global variables
workboxOptionsobjectWorkbox options. See workbox doc for details
useSourceMapbooleanfalseWhether or not enable source map
useWebpackAnalyzerbooleanfalseWhether or not enable webpack-bundle-analyzer plugin
hoststringlocalhostDev server host
portnumber8080Dev server port
proxyobjectDev server proxy. See webpack doc for details

查看示例应用以查看更多详细信息。

License

麻省理工学院

@0y0/webpack-config-react · GitHub licensenpm

@0y0/webpack-config-react is a common webpack config for React.

Installation

npm install @0y0/webpack-config-react --save-dev

Usage

const createWebpackConfig = require('@0y0/webpack-config-react')
const webpackConfig = createWebpackConfig(options)

Options

NameTypeDefaultDescription
isDevbooleantrueWhether or not development environment
appNamestring (required)Application name
rootDirstring (required)Project directory
srcDirstring{rootDir}/srcSource directory
distDirstring{rootDir}/distDistribution directory
staticDirstring{rootDir}/src/staticStatic directory
jsChunksobject{ app: '{rootDir}/src/index.js' }JS entries
htmlChunksobject{ app: '{rootDir}/src/index.html' }HTML entries
publicPathstring/Public path
assetPathstring/Asset path
serviceWorkerPathstring/sw.jsService worker path
resolveAliasobjectModule aliases. See webpack doc for details
chunkGroupsobjectCache groups config of split chunk plugin. See webpack doc for details
variablesobject{}Global variables
workboxOptionsobjectWorkbox options. See workbox doc for details
useSourceMapbooleanfalseWhether or not enable source map
useWebpackAnalyzerbooleanfalseWhether or not enable webpack-bundle-analyzer plugin
hoststringlocalhostDev server host
portnumber8080Dev server port
proxyobjectDev server proxy. See webpack doc for details

Check out the example app to see more details.

License

MIT

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文