livescript-plugin-loader
v2.0.0
Published
Livescript Loader for Webpack with plugin support
Readme
Livescript Loader for Webpack with plugin support.
I'm using it for my personal project so it is probably almost production ready - I'm talking about loader itself plugins are different story.
Repository on github
Plugins
- transform-esm - es modules import & export
- transform-implicit-async - automatic
asyncinsertion - transform-object-create -
Object.createas an implementation of clone operator^^
Installation
Install loader with
npm install --save-dev livescript-plugin-loaderConfiguration
Add loader rule to your webpack.config.ls
module.exports =
module:
rules:
* test: /\.ls$/
exclude: /(node_modules|bower_components)/
use: [
* loader: \livescript-plugin-loader
]
... Source maps
In Firefox I advice to use
devtool: 'source-map'and in Chrome
devtool: 'eval-source-map'Plugins
First install plugins that you want to use
npm install --save-dev livescript-transform-top-level-awaitNext add them to property options.plugins in loader configuration section in webpack.config.ls
* loader: \livescript-plugin-loader
options:
plugins: <[
livescript-transform-implicit-async
livescript-transform-object-create
]>If you want to pass some options to plugin use object instead of array
* loader: \livescript-plugin-loader
options:
plugins:
\livescript-transform-esm : format: \cjsOr use objects instead of strings
* loader: \livescript-plugin-loader
options:
plugins:
* name: \livescript-transform-object-create
options: format: \esm
...Atom integration
If you are using Atom editor you may be interested in my packages which provide realtime code preview.
- livescript-ide-preview - show transpiled code
- atom-livescript-provider - provides compilation service
Under the hood they use the very same plugins as this loader.

Implementation
This loader is small - 62 lines - and quite simple, it does only three things:
- Creates compiler instance
- Loads plugins into compiler
- Executes compiler
