vuejs / vue-style-loader

💅 vue style loader module for webpack

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Inline styles during SSR with V8?

opened this issue · comments

Hi, how I can inject styles in my template during SSR with V8JS?
The docs say that I will get context.styles if used with target: 'node', but where? and what about V8JS?
What do I need to change in my webpack and/or server.js?

webpack.

....
{
          test: /\.vue$/,
          loader: 'vue-loader',
},
{
          test: /\.css$/,
          use: [
            'vue-style-loader',
            'css-loader',
          ],
},
....

server.js

import Test from './components/Test.vue';
const vm = new Vue({
    render: (h) => h(Test),
  });

// exposed by `vue-server-renderer/basic.js`
renderVueComponentToString(vm, (err, res) => {
  print(res)
})

Why was this closed? What's the answer?