diff --git a/docs/zh/guide/README.md b/docs/zh/guide/README.md index 69af40188..27a4dc5f9 100644 --- a/docs/zh/guide/README.md +++ b/docs/zh/guide/README.md @@ -12,7 +12,7 @@ Vue Loader 的配置和其它的 loader 不太一样。除了通过一条规则 ``` js // webpack.config.js -const { VueLoaderPlugin } = require('vue-loader') +const VueLoaderPlugin = require('vue-loader/lib/plugin') module.exports = { module: { @@ -38,7 +38,7 @@ module.exports = { ``` js // webpack.config.js const path = require('path') -const { VueLoaderPlugin } = require('vue-loader') +const VueLoaderPlugin = require('vue-loader/lib/plugin') module.exports = { mode: 'development', diff --git a/docs/zh/guide/pre-processors.md b/docs/zh/guide/pre-processors.md index 8868ecfdd..cf96e9423 100644 --- a/docs/zh/guide/pre-processors.md +++ b/docs/zh/guide/pre-processors.md @@ -142,7 +142,7 @@ npm install -D postcss-loader { test: /\.css$/, use: [ - 'style-loader', + 'vue-style-loader', { loader: 'css-loader', options: { importLoaders: 1 } @@ -172,6 +172,23 @@ npm install -D babel-core babel-loader Babel 的配置可以通过 `.babelrc` 或 `babel-loader` 选项来完成。 +### 排除 node_modules + +`exclude: /node_modules/` 在应用于 `.js` 文件的 JS 转译规则 (例如 `babel-loader`) 中是蛮常见的。鉴于 v15 中的推导变化,如果你导入一个 `node_modules` 内的 Vue 单文件组件,它的 `