From 26105034da4fcce7ac883c899d781f016559310d Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 8 Nov 2018 00:38:48 +0800 Subject: switch to vuepress --- node_modules/vue-style-loader/index.js | 98 ++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 node_modules/vue-style-loader/index.js (limited to 'node_modules/vue-style-loader/index.js') diff --git a/node_modules/vue-style-loader/index.js b/node_modules/vue-style-loader/index.js new file mode 100644 index 00000000..4adcd219 --- /dev/null +++ b/node_modules/vue-style-loader/index.js @@ -0,0 +1,98 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra + Modified by Evan You @yyx990803 +*/ +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) { + 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')) + var addStylesServerPath = loaderUtils.stringifyRequest(this, '!' + path.join(__dirname, 'lib/addStylesServer.js')) + var addStylesShadowPath = loaderUtils.stringifyRequest(this, '!' + path.join(__dirname, 'lib/addStylesShadow.js')) + + var request = loaderUtils.stringifyRequest(this, '!!' + remainingRequest) + var relPath = path.relative(__dirname, this.resourcePath).replace(/\\/g, '/') + var id = JSON.stringify(hash(request + relPath)) + var options = loaderUtils.getOptions(this) || {} + + // 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 || + qs.parse(this.resourceQuery.slice(1)).vue != null + ) + + var shared = [ + '// style-loader: Adds some css to the DOM by adding a