Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[JUST MERGE ME] Russian translation update #791

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

Merged
merged 4 commits into from
Apr 28, 2017
Merged
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
41 changes: 37 additions & 4 deletions 41 docs/ru/configurations/extract-css.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,46 @@
# Извлечение CSS в отдельный файл

Пример конфигурации для извлечения CSS из всех компонентов Vue в отдельный CSS-файл:

### Webpack 2.x

``` bash
npm install extract-text-webpack-plugin --save-dev
```

## Простой путь

> требуется vue-loader@^12.0.0 и webpack@^2.0.0

``` js
// webpack.config.js
var ExtractTextPlugin = require("extract-text-webpack-plugin")

module.exports = {
// другие настройки...
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader',
options: {
extractCSS: true
}
}
]
},
plugins: [
new ExtractTextPlugin("style.css")
]
}
```

Указанный выше пример будет автоматически обрабатывать извлечение `<style>` изнутри `*.vue` файлов и работать с большинством пре-процессоров из коробки.

Обратите внимание, что это будет извлекать только из `*.vue` файлов, для CSS импортрируемого в JavaScript по-прежнему будет требоваться отдельная настройка.

## Конфигурация вручную

Пример конфигурации для извлечения CSS из всех компонентов Vue в отдельный CSS-файл:

### Webpack 2.x

``` js
// webpack.config.js
var ExtractTextPlugin = require("extract-text-webpack-plugin")
Expand Down
4 changes: 2 additions & 2 deletions 4 docs/ru/features/scoped-css.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@

``` html
<style>
.example[_v-f3f3eg9] {
.example[data-v-f3f3eg9] {
color: red;
}
</style>

<template>
<div class="example" _v-f3f3eg9>hi</div>
<div class="example" data-v-f3f3eg9>hi</div>
</template>
```

Expand Down
61 changes: 61 additions & 0 deletions 61 docs/ru/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,3 +185,64 @@ module.exports = {
]
}
```

### extractCSS

> Добавлено в версии 12.0.0

Автоматически извлекает CSS с помощью `extract-text-webpack-plugin`. Работает для большинства пре-процессоров из коробки и минифицирует при сборке в production.

Передаваемое значение может быть `true`, или экземпляром плагина (так что вы можете использовать несколько экземпляров extract plugin для разных извлекаемых файлов).

Это должно использоваться только в production, чтобы горячая перезагрузка модулей работала в процессе разработки.

Например:

``` js
// webpack.config.js
var ExtractTextPlugin = require("extract-text-webpack-plugin")

module.exports = {
// другие настройки...
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader',
options: {
extractCSS: true
}
}
]
},
plugins: [
new ExtractTextPlugin("style.css")
]
}
```

Или можно передать экземпляр плагина:

``` js
// webpack.config.js
var ExtractTextPlugin = require("extract-text-webpack-plugin")
var plugin = new ExtractTextPlugin("style.css")

module.exports = {
// другие настройки...
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader',
options: {
extractCSS: plugin
}
}
]
},
plugins: [
plugin
]
}
```
Morty Proxy This is a proxified and sanitized view of the page, visit original site.