diff --git a/index.js b/index.js index 4adcd219..942e248f 100644 --- a/index.js +++ b/index.js @@ -15,7 +15,6 @@ module.exports.pitch = function (remainingRequest) { 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, '/') @@ -41,41 +40,41 @@ module.exports.pitch = function (remainingRequest) { 'if(content.locals) module.exports = content.locals;' ] - // shadowMode is enabled in vue-cli with vue build --target web-component. - // exposes the same __inject__ method like SSR - if (options.shadowMode) { - return shared.concat([ - '// add CSS to Shadow Root', - 'var add = require(' + addStylesShadowPath + ').default', - 'module.exports.__inject__ = function (shadowRoot) {', - ' add(' + id + ', content, shadowRoot)', - '};' - ]).join('\n') - } else if (!isServer) { - // on the client: dynamic inject + hot-reload - var code = [ - '// add the styles to the DOM', - 'var add = require(' + addStylesClientPath + ').default', - 'var update = add(' + id + ', content, ' + isProduction + ', ' + JSON.stringify(options) + ');' - ] - if (!isProduction) { - code = code.concat([ - '// Hot Module Replacement', - 'if(module.hot) {', - ' // When the styles change, update the