Registry / devops / remove-flow-types-loader

remove-flow-types-loader

JSON →
library1.1.0jsnpmunverified

A webpack loader that strips Flow type annotations from JavaScript files during bundling using flow-remove-types. Current stable version is 1.1.0, with low release cadence (last update in 2017). Designed as a lightweight alternative to full Babel transpilation, it operates as a pre-loader to remove Flow types without transforming other syntax. Useful for projects that only need type stripping and want faster builds. Compared to babel-plugin-flow-strip-types, this loader is leaner but lacks plugin ecosystem integration.

npm install remove-flow-types-loader
INSTALL
IMPORT
SIG · REMOVE-FLOW-TYPES-
R
remove-flow-types-loader
devopsjavascriptv1.1.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18223 runs
build_error
glibc
node 18223 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Loader (in webpack config)
module.exports = { module: { rules: [{ test: /\.jsx?$/, enforce: 'pre', use: ['remove-flow-types-loader'] }] } }
module.exports = { module: { loaders: [{ test: /\.jsx?$/, loader: 'remove-flow-types' }] } }
Webpack 2+ uses rules array with enforce: 'pre'. Using the deprecated loaders or preLoaders syntax is the most common mistake.

Configures webpack to run remove-flow-types-loader as a pre-loader on all .js/.jsx files inside the src directory, stripping Flow types before other loaders.

// webpack.config.js const path = require('path'); module.exports = { mode: 'development', entry: './src/index.js', output: { filename: 'bundle.js', path: path.resolve(__dirname, 'dist') }, module: { rules: [ { test: /\.jsx?$/, enforce: 'pre', use: ['remove-flow-types-loader'], include: path.join(__dirname, 'src') } ] } };
Debug
Known issues
breakingLoader must be used with enforce: 'pre' in webpack 2+; otherwise it runs after other loaders and may corrupt output.
fix
Add 'enforce: "pre"' to the rule object in webpack configuration.
affects: >=1.0.0
deprecatedWebpack 1 preLoaders syntax is deprecated and will cause errors in webpack 2+.
fix
Use module.rules with enforce: 'pre' instead of module.preLoaders.
affects: >=1.0.0
gotchaOptions are passed through to flow-remove-types; invalid options may cause silent failures.
fix
Refer to flow-remove-types documentation for valid options.
affects: >=1.0.0
Errors
Common errors & fixes
Error: 'remove-flow-types-loader' not found
Missing npm install of the loader.
fix
Run 'npm install --save-dev remove-flow-types-loader'
Module build failed: Error: Failed to read config directory .../node_modules/remove-flow-types-loader
Missing peer dependency flow-remove-types.
fix
Run 'npm install --save-dev flow-remove-types'
Upgrade
Version history
1.1.0latest on npm
Audit
Dependencies
flow-remove-typesrequiredCore dependency for stripping Flow type annotations
Agent activity
9 hits · last 30 days
node
8
Resources
remove-flow-types-loader — npm install remove-flow-types-loader · libregistry