npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@imtf/profile-scripts

v2.0.1

Published

Default scripts to bundle & transpile imtf front-end plugins

Readme

@imtf/profile-scripts (Vite + Module Federation)

Overview

profile-scripts is a standardized build and development utility designed for Profile applications within the ICOS.

It provides a vite-based build with optional Module Federation integration.


Installation

npm install --save-dev @imtf/profile-scripts

or

yarn add -D @imtf/profile-scripts

Usage

Start (development/watch mode)

profile-scripts start

Starts the build in watch mode and serves output at:

http://localhost:3010

Build (Production)

profile-scripts build

Generates the production bundle in the build/ directory.


CLI Options

--entryPoint

Specify a custom entry file.

profile-scripts start --entryPoint src/index.ts

If not provided, the following files are checked (in order):

index.ts
index.tsx
index.js
index.jsx
src/index.ts
src/index.tsx
src/index.js
src/index.jsx

--federation

Enable Module Federation support.

profile-scripts start --federation

When enabled:

  • Loads configuration from federation.config.js or federation.config.mjs in project root
  • Integrates with vite-plugin-federation

--externalGlobal

Map external dependencies to global variables (optional).

profile-scripts build --externalGlobal=react/jsx-runtime=window.jsxRuntime

Use this when a dependency is provided globally by the host application and should not be bundled.


Project Requirements

Minimal structure:

project-root/
  src/
    index.tsx (or equivalent entry)
  package.json

For Module Federation:

federation.config.js

Remote Application Requirements

To enable Module Federation integration, the remote application must be configured as follows.

Module Federation Configuration

module.exports = {
  name: "remote-app",
  exposes: {
    "./App": "./src/App",
  },
  filename: "remoteEntry.js",
  library: { type: "module" }, // **required**
};

Build Configuration

experiments: { outputModule: true },

externalsType: "global",

externals: {
  react: "React",
  "react-dom": "ReactDOM",
};

Notes

  • The library.type = "module" configuration is mandatory for compatibility with vite-based host applications
  • outputModule: true ensures the remote is emitted as an ES module
  • React dependencies must be externalised and provided by the host application

SVG Handling

Built-in SVG support:

  • Files inside src/ → transformed into React components
  • Files inside src/assets/ or outside src/ → converted to base64 data URLs

CSS Handling

CSS is automatically injected into the JavaScript bundle.
No separate CSS files are generated.


Output

Build output:

build/
  index.js
  • Format: IIFE
  • Designed for integration into host applications

Environment Variable

IMTF_MINIFY_WEBAPP

Controls minification:

IMTF_MINIFY_WEBAPP=false profile-scripts build
  • Default: minification enabled
  • Uses Vite default minifier

Notes

  • vite is the default build system
  • Module Federation is enabled only via --federation
  • Entry point is optional but must resolve to a valid file
  • External globals should be used only when dependencies are provided by the host

Profile Configuration

Two supported approaches are available based on how the remote is resolved.


Option 1: URL-based Remote (Static)

export default {
  name: "host-app",
  remotes: {
    remoteModule: {
      externalType: "url",
      external: "http://localhost:3021/remoteEntry.js",
      from: "webpack",
      format: "esm",
    },
  },
};

Option 2: Promise-based Remote (Dynamic)

Use this when the remote URL needs to be resolved dynamically at runtime.

export default {
  name: "host-app",
  remotes: {
    remoteapp: {
      externalType: "promise",
      external: "<<resolver function as string>>",
      from: "webpack",
      format: "esm",
    },
  },
};

Troubleshooting

Entry point not found

Ensure one of the supported entry files exists or pass --entryPoint.


Federation configuration missing

Ensure federation.config.js or .mjs exists when using --federation.


Runtime dependency issues

If a dependency is expected from the host, configure it using --externalGlobal.