runtime-compress-loader
Remove the helpers, babel and typescript inlined to the every fileWhat 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
- babel-plugin-transform-runtime - and the why. User babel to do the job.
- tslib -
importHelpers
for typescript
Licence
MIT