gkz / LiveScript

LiveScript is a language which compiles to JavaScript. It has a straightforward mapping to JavaScript and allows you to write expressive code devoid of repetitive boilerplate. While LiveScript adds many features to assist in functional style programming, it also has many improvements for object oriented and imperative programming.
http://livescript.net
MIT License
2.32k stars 155 forks source link

Add documentation how to bundle livescript with webpack #1008

Closed bartosz-m closed 6 years ago

bartosz-m commented 6 years ago

Long story short I've needed to bundle livescript, but webpack was complaining with some errors, so I came up with this piece of code:

# webpack.config.ls
add-livescript-requirements = (module-exports) ->
    module-exports
        ..node <<<
            fs: "empty"
            net: "mock"
            module: "empty"
        ..[]plugins.push do
            new webpack.DefinePlugin do
                "require.extensions": {}

... # rest of config file

add-livescript-requirements module.exports

Some information in docs about how to configure webpack for bundling livescript would be nice.

rhendric commented 6 years ago

Cool! I think this would be better off on the wiki rather than in the formal LiveScript documentation. This is not, after all, information about LiveScript, either the language or the tool; it's information about how to integrate LiveScript with a different tool. I don't want to have to worry about updating LiveScript's docs if webpack ever changes; the community using webpack and LS together should be responsible for that. Would you create the wiki page for this?

bartosz-m commented 6 years ago

I don't mind writing wiki page, but I'm quite puzzled where it should be put. If not in livescript repo then where would be a right place?

rhendric commented 6 years ago

Oh no, I meant in the LiveScript repo wiki! (As opposed to the formal livescript.net docs.)

bartosz-m commented 6 years ago

Ok. Then I'll double check with minimal project if my snippet works without problem, and I'll create new page that describes how to make livescript and webpack play nice together.
Would it be ok add some more pages about different tools? Recently I stater using livescript with yadda and mocha so I can write about them.

rhendric commented 6 years ago

Absolutely, that would be very welcome!

bartosz-m commented 6 years ago

Added wiki page for bundling livescript with webpack. If its content is ok, this issue can be closed

rhendric commented 6 years ago

That looks great, thank you!