open-index/open-npm huggingface dataset:
npm package: @padcom/vite-config-default
Description: This package exposes a function that defines a default Vite configuration. The default configuration consists of the following elements:
Author: Matthias Hryniszak
Latest version: 0.11.0

# Default Vite configuration

This package exposes a function that defines a default Vite configuration.
The default configuration consists of the following elements:

## Base configuration

- the `@/` alias to `./src`
- [vite-eslint-plugin](https://www.npmjs.com/package/vite-plugin-eslint/v/1.8.1) plugin

The base configuration (without vitest-based testing) can be used through the
`defineBaseConfig()` function

## Test configuration

- `./vitest.setup.js` initialization file
- test coverage using [@vitest/coverage-v8](https://npmjs.com/package/@vitest/coverage-v8/v/1.5.2)

The test configuration can be used standalone throug the `defineTestConfig()` function
npm package: @padcom/vite-config-lib
Description: Vite configuration for a TypeScript library
Author: Matthias Hryniszak
Latest version: 0.11.0

# Vite configuration for libraries

This package exposes a function that defines a a Vite configuration for libraries.
The default configuration consists of the following elements:

## Base library configuration

- [vite-dts-plugin](https://www.npmjs.com/package/vite-plugin-dts/v/0.6.0) plugin

The base library configuration (without vitest-based testing) can be used through the
`defineBaseLibConfig()` function

## Externals configuration

Packages specified in `package.json' in the following sections are automatically added to externals:

- `dependencies`
- `peerDependencies`
- `optionslDependencies`

The externals configuration can be used standalone throug the `defineExternalsConfig()`
function
npm package: @padcom/vite-config-vue
Description: Vite configuration for Vue.js application
Author: Matthias Hryniszak
Latest version: 0.14.1

# Vite configuration for Vue.js applications

This package exposes a function that defines a a Vite configuration for Vue.js applications.
The default configuration consists of the following elements:

## Base configuration

- the `@/` alias to `./src`
- [vite-eslint-plugin](https://www.npmjs.com/package/vite-plugin-eslint/v/1.8.1) plugin
- [@vitejs/plugin-vue](https://npmjs.com/package/@vitejs/plugin-vue/v/5.0.4)
- [@vue/test-utils](https://npmjs.com/package/@vue/test-utils/v/2.4.5)
- [autoprefixer](https://npmjs.com/package/autoprefixer/v/10.4.19)
- [vite-svg-loader](https://npmjs.com/package/vite-svg-loader/v/5.1.0) (by default in component import mode)
- [vite-dts-plugin](https://www.npmjs.com/package/vite-plugin-dts/v/0.6.0) plugin

## Test configuration

- `./vitest.setup.js` initialization file
- test coverage using [@vitest/coverage-v8](https://npmjs.com/package/@vitest/coverage-v8/v/1.5.2)
- [@vue/test-utils](https://npmjs.com/package/@vue/test-utils/v/2.4.5)
- [jsdom](https://npmjs.com/package/jsdom/v24.0.0)

This configuration sets up testing using [vitest](https://npmjs.com/package/vitest)
npm package: @padcom/vite-config-vue-lib
Description: Vite configuration for Vue.js library
Author: Matthias Hryniszak
Latest version: 0.11.0

# Vite configuration for Vue.js libraries

This package exposes a function that defines a a Vite configuration for Vue.js applications.
The default configuration consists of the following elements:

## Base configuration

- the `@/` alias to `./src`
- [vite-eslint-plugin](https://www.npmjs.com/package/vite-plugin-eslint/v/1.8.1) plugin
- [@vitejs/plugin-vue](https://npmjs.com/package/@vitejs/plugin-vue/v/5.0.4)
- [@vue/test-utils](https://npmjs.com/package/@vue/test-utils/v/2.4.5)
- [autoprefixer](https://npmjs.com/package/autoprefixer/v/10.4.19)
- [tailwindcss](https://npmjs.com/package/tailwindcss/v/3.4.3)
- [vite-svg-loader](https://npmjs.com/package/vite-svg-loader/v/5.1.0) (by default in component import mode)

The base library configuration (without vitest-based testing) can be used through the
`defineVueBaseConfig()` function

## Test configuration

This configuration sets up testing using [vitest](https://npmjs.com/package/vitest)

- `./vitest.setup.js` initialization file
- test coverage using [@vitest/coverage-v8](https://npmjs.com/package/@vitest/coverage-v8/v/1.5.2)
- [@vue/test-utils](https://npmjs.com/package/@vue/test-utils/v/2.4.5)
- [jsdom](https://npmjs.com/package/jsdom/v24.0.0)
npm package: @padcom/vite-default-config
Description: This package exposes a function that defines a default Vite configuration. The default configuration consists of the following elements:
Author: Matthias Hryniszak
Latest version: 0.0.3

# Default Vite configuration

This package exposes a function that defines a default Vite configuration.
The default configuration consists of the following elements:

## Base configuration

- the `@/` alias to `./src`
- [vite-eslint-plugin](https://www.npmjs.com/package/vite-plugin-eslint/v/1.8.1) plugin

The base configuration (without vitest-based testing) can be used through the
`defineBaseConfig()` function

## Test configuration

- `./vitest.setup.js` initialization file
- test coverage using [@vitest/coverage-v8](https://npmjs.com/package/@vitest/coverage-v8/v/1.5.2)

The test configuration can be used standalone throug the `defineTestConfig()` function
npm package: @padcom/vite-lib-config
Description: Vite configuration for a TypeScript library
Author: Matthias Hryniszak
Latest version: 0.0.3

# Vite configuration for libraries

This package exposes a function that defines a a Vite configuration for libraries.
The default configuration consists of the following elements:

## Base library configuration

- [vite-dts-plugin](https://www.npmjs.com/package/vite-plugin-dts/v/0.6.0) plugin

The base library configuration (without vitest-based testing) can be used through the
`defineBaseLibConfig()` function

## Externals configuration

Packages specified in `package.json' in the following sections are automatically added to externals:

- `dependencies`
- `peerDependencies`
- `optionslDependencies`

The externals configuration can be used standalone throug the `defineExternalsConfig()`
function
npm package: @padcom/vite-plugin-federation
Description: Vite federation plugin automatic configurator
Author: Matthias Hryniszak
Latest version: 0.0.10

# @padcom/vite-plugin-federation

This is a configuration plugin for [@originjs/vite-plugin-federation](https://www.npmjs.com/package/@originjs/vite-plugin-federation). It allows, instead of crafting the configuration each time manually, to get it configured with data from `package.json`.

## Installation

To install the package issue the following command:

```
$ npm install --save-dev @padcom/vite-plugin-federation
```

## Configuration

Once the plugin is installed you need to let Vite know you want to use it:

```
vite.config.js:

import { defineConfig } from 'vite'
import federation from '@padcom/vite-plugin-federation'

export default defineConfig({
  build: {
    target: 'esnext',
  },
  plugins: [
    federation(),
  ],
})
```

That's it! No more manual federation configuration!

## What's in the box?

Once you install this plugin the following will happen:

1. The name of the exposed package will come from either the `package.json`/`name` or from `package.json`/`federation/name`.
2. Shared dependencies will be loaded from `package.json`/`dependencies`
3. If there is no `remotes` section in `package.json`/`federation` then the exposed elements will be either `package.json`/`federation/exposes` or

```
{
  './root': './src/index.js'
}
```
4. If `package.json`/`remotes` is set then there are no automatic exposes and whatever is added to `package.json`/`exposes` will be forwarded to the underlying plugin.

So if you're creating a federated module and you just want to expose everything all at once then create a file `./src/index.js` in your project, export all your elements from that file and you're all set.

### Importing exposed elements

Once your library is ready you can import it in another project like so:

```
const library = await import('libraryName/root')
const root = library.default
```

### Configuring for different environments

To tell the federation plugin where the right version of the library is we can use the `mode` switch from vite. The plugin uses [dotenv](https://www.npmjs.com/package/dotenv) and if the content of the location of the remote is found in environment variables then it is automatically substituted with the value of that env variable from `.env` file in your project's root folder:

```
LIBRARY_URL=http://localhost:5001/assets/remoteEntry.js
```

and then use it in `package.json`

```
{
  "federation": {
    "remotes": {
      "library": "LIBRARY_URL"
    }
  }
}
```

If you want to provide a differenty URL for production create the `.env.production` file with the following content:

```
LIBRARY_URL=https://somewhere.on-the-internet.net/assets/remoteEntry.js
```