diff --git a/README.md b/README.md index e6b41d32..e150c931 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ This is a fork based on [style-loader](https://github.com/webpack/style-loader). ### Server-Side Rendering Support -When bundling with `target: 'node'`, the styles in all rendered components are collected and exposed on the Vue render context object as `context.styles`, which you can simply inline into your markup's ``. If you are building a Vue SSR app, you probably should use this loader for CSS imported from JavaScript files too. +When bundling with `target: 'node'` or `target: 'webworker'`, the styles in all rendered components are collected and exposed on the Vue render context object as `context.styles`, which you can simply inline into your markup's ``. If you are building a Vue SSR app, you probably should use this loader for CSS imported from JavaScript files too. ### Misc diff --git a/index.js b/index.js index 4adcd219..b6a1c9a6 100644 --- a/index.js +++ b/index.js @@ -11,7 +11,7 @@ var qs = require('querystring') module.exports = function () {} module.exports.pitch = function (remainingRequest) { - var isServer = this.target === 'node' + var isServer = this.target === 'node' || this.target === 'webworker' 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'))