Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: vuejs/vue-loader
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v15.9.2
Choose a base ref
...
head repository: vuejs/vue-loader
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v15.9.3
Choose a head ref
  • 6 commits
  • 6 files changed
  • 2 contributors

Commits on May 1, 2020

  1. chore: v15.9.2 changelog

    haoqunjiang committed May 1, 2020
    Copy the full SHA
    0cf2b15 View commit details

Commits on Jun 4, 2020

  1. Copy the full SHA
    e081dc4 View commit details

Commits on Jun 23, 2020

  1. fix: skip matching rule with 'enforce'

    backports #1680
    haoqunjiang committed Jun 23, 2020
    Copy the full SHA
    e7b2b11 View commit details
  2. Copy the full SHA
    faf0934 View commit details
  3. Copy the full SHA
    fc1ebc1 View commit details
  4. 15.9.3

    haoqunjiang committed Jun 23, 2020
    Copy the full SHA
    b4e95a7 View commit details
Showing with 375 additions and 194 deletions.
  1. +15 −0 CHANGELOG.md
  2. +1 −1 docs/guide/scoped-css.md
  3. +4 −0 lib/plugin-webpack5.js
  4. +2 −2 package.json
  5. +14 −0 test/advanced.spec.js
  6. +339 −191 yarn.lock
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
<a name="15.9.2"></a>
## [15.9.2](https://github.com/vuejs/vue-loader/compare/v15.9.1...v15.9.2) (2020-05-01)


### Bug Fixes

* fix getting shadow root when component is functional ([#1560](https://github.com/vuejs/vue-loader/issues/1560)) ([9a7357a](https://github.com/vuejs/vue-loader/commit/9a7357a))


### Documentation

* add DocSearch as recommended by vuepress ([#1662](https://github.com/vuejs/vue-loader/issues/1662)) ([032d56b](https://github.com/vuejs/vue-loader/commit/032d56b))



<a name="15.9.1"></a>
## [15.9.1](https://github.com/vuejs/vue-loader/compare/v15.9.0...v15.9.1) (2020-03-19)

2 changes: 1 addition & 1 deletion docs/guide/scoped-css.md
Original file line number Diff line number Diff line change
@@ -70,6 +70,6 @@ DOM content created with `v-html` are not affected by scoped styles, but you can

## Also Keep in Mind

- **Scoped styles do not eliminate the need for classes**. Due to the way browsers render various CSS selectors, `p { color: red }` will be many times slower when scoped (i.e. when combined with an attribute selector). If you use classes or ids instead, such as in `.example { color: red }`, then you virtually eliminate that performance hit. [Here's a playground](https://stevesouders.com/efws/css-selectors/csscreate.php) where you can test the differences yourself.
- **Scoped styles do not eliminate the need for classes**. Due to the way browsers render various CSS selectors, `p { color: red }` will be many times slower when scoped (i.e. when combined with an attribute selector). If you use classes or ids instead, such as in `.example { color: red }`, then you virtually eliminate that performance hit.

- **Be careful with descendant selectors in recursive components!** For a CSS rule with the selector `.a .b`, if the element that matches `.a` contains a recursive child component, then all `.b` in that child component will be matched by the rule.
4 changes: 4 additions & 0 deletions lib/plugin-webpack5.js
Original file line number Diff line number Diff line change
@@ -38,6 +38,10 @@ class VueLoaderPlugin {
let vueRules = []

for (const rawRule of rules) {
// skip rules with 'enforce'. eg. rule for eslint-loader
if (rawRule.enforce) {
continue
}
// skip the `include` check when locating the vue rule
const clonedRawRule = Object.assign({}, rawRule)
delete clonedRawRule.include
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-loader",
"version": "15.9.2",
"version": "15.9.3",
"description": "Vue single-file component loader for Webpack",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
@@ -88,7 +88,7 @@
"stylus-loader": "^3.0.2",
"sugarss": "^1.0.1",
"ts-loader": "^4.2.0",
"typescript": "^2.8.3",
"typescript": "^3.9.5",
"url-loader": "^1.0.1",
"vue": "^2.5.16",
"vue-server-renderer": "^2.5.16",
14 changes: 14 additions & 0 deletions test/advanced.spec.js
Original file line number Diff line number Diff line change
@@ -241,6 +241,20 @@ test('support rules with oneOf', async () => {
})
})

test('should work with eslint loader', async () => {
// TODO:
return new Promise(resolve => {
bundle({
entry: 'basic.vue',
modify: config => {
config.module.rules.unshift({
test: /\.vue$/, loader: 'vue-loader', enforce: 'pre'
})
}
}, () => resolve())
})
})

// TODO
// test('multiple rule definitions', done => {
// mockBundleAndRun({
Loading