Skip to content

Commit 0c7ee9d

Browse files
committed
feat: support vue-loader 15
1 parent 7a9f3f8 commit 0c7ee9d

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Diff for: index.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@
66
var loaderUtils = require('loader-utils')
77
var path = require('path')
88
var hash = require('hash-sum')
9+
var qs = require('querystring')
910

1011
module.exports = function () {}
1112

1213
module.exports.pitch = function (remainingRequest) {
13-
if (this.cacheable) this.cacheable()
14-
1514
var isServer = this.target === 'node'
1615
var isProduction = this.minimize || process.env.NODE_ENV === 'production'
1716
var addStylesClientPath = loaderUtils.stringifyRequest(this, '!' + path.join(__dirname, 'lib/addStylesClient.js'))
@@ -25,7 +24,11 @@ module.exports.pitch = function (remainingRequest) {
2524
// direct css import from js --> direct, or manually call `styles.__inject__(ssrContext)` with `manualInject` option
2625
// css import from vue file --> component lifecycle linked
2726
// style embedded in vue file --> component lifecycle linked
28-
var isVue = /"vue":true/.test(remainingRequest) || options.manualInject
27+
var isVue = (
28+
/"vue":true/.test(remainingRequest) ||
29+
options.manualInject ||
30+
qs.parse(this.resourceQuery.slice(1)).vue != null
31+
)
2932

3033
var shared = [
3134
'// style-loader: Adds some css to the DOM by adding a <style> tag',

0 commit comments

Comments
 (0)