NightCatSama / vue-slider-component

🌡 A highly customized slider component
https://nightcatsama.github.io/vue-slider-component
MIT License
2.39k stars 341 forks source link

SSR compatibility #114

Open acupofspirt opened 6 years ago

acupofspirt commented 6 years ago

Hi, is it SSR compatible? Because I got some errors like "document is not defined" when using rendering in Node environment (no NUXT).

NightCatSama commented 6 years ago

Sorry, the component does not support the SSR.

acupofspirt commented 6 years ago

@NightCatSama, I solved that with importing plugin source file like

 import cVueSlider from 'vue-slider-component/src/vue2-slider.vue'

and in webpack config

{
   test: /\.vue?$/,
   exclude: /node_modules\/(?!vue-slider-component)/,
   loader: 'vue-loader'
}

This approach works because if we let vue-server-renderer/server-plugin work with raw(not minified and compiled) .vue files with