stealjs / rfcs

A place to discuss higher level changes to Steal
MIT License
2 stars 0 forks source link

Vue plugin #1

Closed matthewp closed 7 years ago

matthewp commented 7 years ago

From https://github.com/stealjs/steal/issues/839, what is wanted is a plugin to load .vue modules.

marshallswain commented 7 years ago

I've started development on this here: https://github.com/icanjs/steal-vue

It works, but I need some help getting the styles to load. It looks like it's trying to load them as JavaScript. @matthewp, if you get a minute, could you take a look at how I'm loading the styles and see what I need to change? It's in the styles branch, here: https://github.com/icanjs/steal-vue/blob/styles/steal-vue.js#L23 At that point, the styles are just a plain string, but I'm not sure how to tell Steal that it's CSS and not JS.

Here's the error: screen shot 2017-03-25 at 3 49 00 pm

And here's what the styles look like that this point: screen shot 2017-03-25 at 3 49 51 pm

matthewp commented 7 years ago

I think the problem is that loader.define needs a full module name and that's probably just a module identifier. Looking at what done-component does, it runs it through loader.normalize which should give you the full module name.

Also, you don't need an extra set of double-quotes.

marshallswain commented 7 years ago

@matthewp Thanks! That got me to where I needed to be. I just copied some code from done-component and the styles work, now.

matthewp commented 7 years ago

Cool, do you consider that ready enough that this issue can be closed?

marshallswain commented 7 years ago

It seems to work quite well. Works with CSS and Less files. I didn't try Sass, but assume it works with that plugin, too. It's on npm, now: https://www.npmjs.com/package/steal-vue