runtime-compress-loader

babel and typescript runtime optimization loader

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
runtime-compress-loader
1.0.06 years ago6 years agoMinified + gzip package size for runtime-compress-loader in KB

Readme

runtime-compress-loader

Remove the helpers, babel and typescript inlined to the every file

What it does

Finds babel and typescript helpers and replaces them by code from @babel/runtime and tslib
It's usually a kilobyte in every file you have a class inside.

Usage

Just add this webpack loader before any other for nodemodules, and after any other for other locations.

For project files

{
    test: /\.js$/,
    exclude: /node_modules/,
    loaders: ['runtime-compress-loader', 'babel-loader'],  
}

For node modules

{
    test: /\.js$/,
    include: /node_modules/,
    loaders: ['runtime-compress-loader'],  
}

For any location

```js {
test: /\.js$/,
loaders: ['runtime-compress-loader', 'babel-loader', 'runtime-compress-loader'],  
} ```

Other ways

For project, not yet transpiled files only.
  • tslib - importHelpers for typescript
Licence
MIT