Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

documentation for urlLoaderExcludes #793

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ Index:
* [ignoreMomentLocale](#ignoremomentlocale)
* [disableDynamicImport](#disabledynamicimport)
* [env](#env)
* [urlLoaderExcludes](#urlLoaderExcludes)

### entry

Expand Down Expand Up @@ -329,6 +330,17 @@ e.g.

Thus, extraBabelPlugins in development is `['transform-runtime', 'dva-hmr']`, and `['transform-runtime']` in production.

### urlLoaderExcludes

Exclude files for `url-loader`.

You should configure this option when you are using `webpack loader` to generate source code.
Otherwise the generated source code will be encoded as base64 data url.

```js
"urlLoaderExcludes": [path.join(__dirname, 'src/parser.jison')],
```

## Environment Variables

You can temporarily configure some parameters for environment variables, including:
Expand Down
12 changes: 12 additions & 0 deletions README_zh-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ export default {
* [ignoreMomentLocale](#ignoremomentlocale)
* [disableDynamicImport](#disabledynamicimport)
* [env](#env)
* [urlLoaderExcludes](#urlLoaderExcludes)

### entry

Expand Down Expand Up @@ -311,6 +312,17 @@ export default {

这样,开发环境下的 extraBabelPlugins 是?`["transform-runtime", "dva-hmr"]`,而生产环境下是?`["transform-runtime"]`。

### urlLoaderExcludes

配置不需要通过 `url-loader` 处理的文件。

当使用其他非默认 `webpack loader` 生成代码时需要配置这个选项。
否则生成出来的代码会被 base64 编码。

```js
"urlLoaderExcludes": [path.join(__dirname, 'src/parser.jison')],
```

## 环境变量

可环境变量临时配置一些参数,包括:
Expand Down