survivejs / webpack-book

From apprentice to master (CC BY-NC-ND)
https://survivejs.com/webpack/
2.42k stars 319 forks source link

Show how to process within LESS/SASS and such #11

Closed bebraw closed 8 years ago

bebraw commented 9 years ago

Apparently something like @import "~theo?less!./file.json" should work within LESS files. The idea here is that ./file/json gets processed by a tool known as theo. After processing it is something less loader can take care of.

christianalfoni commented 9 years ago

Yeah, @import is the same as ES6 import statement and require. Kinda cool actually.

So theo converts a JSON to LESS valid code? What is theo?

bebraw commented 9 years ago

I'm picking these issues from Gitter. In this case I'm not absolutely sure that the recipe will work out of box but the idea is valid.

So theo converts a JSON to LESS valid code? What is theo?

Theo is apparently one of those tools that could do this sort of transformation (JSON -> LESS). See https://www.npmjs.com/package/theo .

It would be a good idea to cover how to build pipelines like this and how to develop loaders themselves. That gives more understanding over how Webpack works.

christianalfoni commented 9 years ago

Yeah, I could really benefit from diving into plugins and loaders. Hopefully I will find some time soon :-) Its good to see that the cookbook is starting to at least get content on every page. Give it a few more days and we should have at least a "complete first draft" :-) Then we can start iterating and only add new stuff when we actually have content for it, hehe

bebraw commented 8 years ago

Done.