{"id":20813,"library":"webpack-remote-types-plugin","title":"WebpackRemoteTypesPlugin","description":"Webpack plugin (v0.2.7) that downloads TypeScript type definition tarballs generated by dts-loader from remote locations (e.g., a remote Module Federation entry). It integrates with webpack's build process to fetch type definitions files at build time and unzips them into a local directory. Key differentiator: enables type checking for remote modules in a Micro-Frontend setup where type definitions are served alongside remoteEntry.js. Release cadence is irregular; currently stable but low activity.","status":"active","version":"0.2.7","language":"javascript","source_language":"en","source_url":"https://github.com/ruanyl/webpack-remote-types-plugin","tags":["javascript","typescript"],"install":[{"cmd":"npm install webpack-remote-types-plugin","lang":"bash","label":"npm"},{"cmd":"yarn add webpack-remote-types-plugin","lang":"bash","label":"yarn"},{"cmd":"pnpm add webpack-remote-types-plugin","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Runs as a webpack plugin; requires a webpack project (v4 or v5 likely)","package":"webpack","optional":false},{"reason":"Plugin expects dts-loader to generate the tarballs it downloads; not a runtime dep but conceptually required","package":"dts-loader","optional":true}],"imports":[{"note":"Default export via ESM. If using CJS, use require with default property or use a module bundler that handles ESM interop.","wrong":"const WebpackRemoteTypesPlugin = require('webpack-remote-types-plugin')","symbol":"WebpackRemoteTypesPlugin","correct":"import WebpackRemoteTypesPlugin from 'webpack-remote-types-plugin'"},{"note":"CommonJS require does not resolve default export automatically in all setups; must use .default or set esModuleInterop.","wrong":"const WebpackRemoteTypesPlugin = require('webpack-remote-types-plugin');","symbol":"WebpackRemoteTypesPlugin","correct":"const WebpackRemoteTypesPlugin = require('webpack-remote-types-plugin').default;"},{"note":"TypeScript types are bundled; for type-only imports use the 'import type' syntax.","wrong":"type WebpackRemoteTypesPluginOptions = { remotes: object; outputDir: string; remoteFileName: string; }","symbol":"WebpackRemoteTypesPluginOptions","correct":"import type { WebpackRemoteTypesPluginOptions } from 'webpack-remote-types-plugin'"}],"quickstart":{"code":"// webpack.config.js\nconst WebpackRemoteTypesPlugin = require('webpack-remote-types-plugin').default;\n\nmodule.exports = {\n  plugins: [\n    new WebpackRemoteTypesPlugin({\n      remotes: {\n        app: 'app@http://localhost:9000/remoteEntry.js',\n      },\n      outputDir: 'types',\n      remoteFileName: '[name]-dts.tgz',\n    }),\n  ],\n};","lang":"javascript","description":"Configures the plugin to fetch and extract type definitions for a remote 'app' from localhost:9000 into a './types' directory."},"warnings":[{"fix":"Always specify 'remoteFileName' explicitly to avoid breaking changes.","message":"The 'remoteFileName' option may be automatically derived in future versions.","severity":"deprecated","affected_versions":">=0.2.0"},{"fix":"Replace 'filename' with 'remoteFileName' in your configuration.","message":"In version 0.2.x, the plugin no longer supports the legacy 'filename' option; use 'remoteFileName' instead.","severity":"breaking","affected_versions":">=0.2.0"},{"fix":"Verify the URL pattern: e.g., if remote is 'app' and remoteFileName is '[name]-dts.tgz', the full URL becomes http://localhost:9000/app-dts.tgz (base URL taken from the remoteEntry URL).","message":"The tarball URL is constructed by replacing '[name]' in 'remoteFileName' with the remote name. Ensure your server serves the file at that exact path.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run 'npm install webpack-remote-types-plugin --save-dev' or add it to devDependencies.","cause":"Package not installed or incorrect import path.","error":"Error: Cannot find module 'webpack-remote-types-plugin'"},{"fix":"Use 'const WebpackRemoteTypesPlugin = require('webpack-remote-types-plugin').default;'","cause":"Using default export incorrectly in CommonJS environment.","error":"TypeError: WebpackRemoteTypesPlugin is not a constructor"},{"fix":"Check that the remote URL is accessible and that 'remoteFileName' matches the actual tarball filename on the server.","cause":"Remote server not returning the tarball or URL mismatch.","error":"Error: ENOENT: no such file or directory, stat 'types/app-dts.tgz'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}