Skip to content

Commit

Permalink
feat: support vue-loader 15
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Mar 20, 2018
1 parent 7a9f3f8 commit 0c7ee9d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@
var loaderUtils = require('loader-utils')
var path = require('path')
var hash = require('hash-sum')
var qs = require('querystring')

module.exports = function () {}

module.exports.pitch = function (remainingRequest) {
if (this.cacheable) this.cacheable()

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

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

0 comments on commit 0c7ee9d

Please sign in to comment.