https://github.com/dsathyakumar/lasso-minify-transpile-inline
Lasso JS plugin to minify & transpile inline assets that are not of type: require
https://github.com/dsathyakumar/lasso-minify-transpile-inline
babel inline lasso minify transpile
Last synced: 16 days ago
JSON representation
Lasso JS plugin to minify & transpile inline assets that are not of type: require
- Host: GitHub
- URL: https://github.com/dsathyakumar/lasso-minify-transpile-inline
- Owner: dsathyakumar
- Created: 2019-02-15T19:55:21.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-12-17T17:36:24.000Z (over 5 years ago)
- Last Synced: 2026-05-17T09:51:48.245Z (about 2 months ago)
- Topics: babel, inline, lasso, minify, transpile
- Language: JavaScript
- Homepage:
- Size: 21.5 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# lasso-minify-transpile-inline
A minimalist [lasso](https://github.com/lasso-js/lasso) plugin that minifes and transpiles inline source files, that do not have to be wrapped by `$_mod` - the [lasso client side runtime](https://github.com/lasso-js/lasso-modules-client)
## What it does?
- `transpiles` & `minifes` inline source files via `babel-core` & places them in the specified slot.
## Usage
```javascript
{
'type': 'minify-transpile-inline',
'inline': true,
'path': './path/to/my/jsfile.js',
'slot': 'mySlot'
}
```
## Why is this needed?
This is different from :
```javascript
{
'inline': true,
'run': true,
'type': 'require',
'path': './path/to/my/jsfile.js',
'slot': 'mySlot'
}
```
Marking as `type: require` will cause the file to be wrapped by the [lasso-modules-client](https://github.com/lasso-js/lasso-modules-client) variable - `$_mod`. In most cases, this definition comes bundled with the externalized script containing the dependencies of your entire page. Just in case, you need to execute a script, on page load, before the externalized JS loads, this plugin helps do it, without wrapping it with the variable - `$_mod`.
### Include this plugin in the lasso config as:
```json
"lasso": {
"plugins": [
"lasso-less",
"lasso-autoprefixer",
"lasso-marko",
"lasso-minify-transpile-inline"
],
"minify": false,
"minifyInlineOnly": true,
"bundlingEnabled": true,
"resolveCssUrls": true,
"noConflict": "gh-fe",
"cacheProfile": "production"
}
```
### Babel config
This will pick the parent project's Babel configuration.