mirror of https://github.com/ElemeFE/element
Merge pull request #1578 from QingWei-Li/fix/i18n-doc
doc: IgnorePlugin => NormalModuleReplacementPlugin, fixed #1315pull/1581/head
commit
67a009b7a7
|
@ -26,13 +26,13 @@ Vue.component(Button.name, Button)
|
|||
Vue.component(Select.name, Select)
|
||||
```
|
||||
|
||||
The Chinese language pack is imported by default, even if you're using another language. But with `IgnorePlugin` provided by webpack you can ignore it when building:
|
||||
The Chinese language pack is imported by default, even if you're using another language. But with `NormalModuleReplacementPlugin` provided by webpack you can replace default locale:
|
||||
|
||||
webpack.config.js
|
||||
```javascript
|
||||
{
|
||||
plugins: [
|
||||
new webpack.IgnorePlugin(/element-ui\/lib\/locale\/lang\/zh-CN/)
|
||||
new webpack.NormalModuleReplacementPlugin(/element-ui[\/\\]lib[\/\\]locale[\/\\]lang[\/\\]zh-CN/, 'element-ui/lib/locale/lang/en')
|
||||
]
|
||||
}
|
||||
```
|
||||
|
|
|
@ -38,13 +38,13 @@ Vue.component(Button.name, Button)
|
|||
Vue.component(Select.name, Select)
|
||||
```
|
||||
|
||||
如果使用其它语言,默认情况下中文语言包依旧是被引入的,可以使用 webpack 的 IgnorePlugin 忽略掉它以减少打包后的文件体积。
|
||||
如果使用其它语言,默认情况下中文语言包依旧是被引入的,可以使用 webpack 的 NormalModuleReplacementPlugin 替换默认语言包。
|
||||
|
||||
**webpack.config.js**
|
||||
```javascript
|
||||
{
|
||||
plugins: [
|
||||
new webpack.IgnorePlugin(/element-ui\/lib\/locale\/lang\/zh-CN/)
|
||||
new webpack.NormalModuleReplacementPlugin(/element-ui[\/\\]lib[\/\\]locale[\/\\]lang[\/\\]zh-CN/, 'element-ui/lib/locale/lang/en')
|
||||
]
|
||||
}
|
||||
```
|
||||
|
|
Loading…
Reference in New Issue