runtime-compress-loader
v1.0.0
Published
babel and typescript runtime optimization loader
Downloads
2
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 node_modules, 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
{
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. For project, not yet transpiled files only.
tslib -
importHelpers
for typescript
Licence
MIT