diff --git a/index.js b/index.js index ac9629ae..6ff8e6e8 100644 --- a/index.js +++ b/index.js @@ -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