Skip to content

judge isVue from loader options also #13

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 5 commits into from
Jan 24, 2018
Merged
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
7 changes: 4 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ module.exports.pitch = function (remainingRequest) {
var addStylesServerPath = loaderUtils.stringifyRequest(this, '!' + path.join(__dirname, 'lib/addStylesServer.js'))

var request = loaderUtils.stringifyRequest(this, '!!' + remainingRequest)
var id = JSON.stringify(hash(request))
var id = JSON.stringify(hash(request + this.resourcePath))
var options = loaderUtils.getOptions(this) || {}

// direct css import from js --> direct (how does this work when inside an async chunk? ...just don't do it)
// 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)
var isVue = /"vue":true/.test(remainingRequest) || options.manualInject

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