open-index/open-npm huggingface dataset:
npm package: @inlang/paraglide-rollup
Description: Rollup Plugin for running the Paraglide i18n compiler
Author: inlang
Latest version: 1.0.89
Deprecated: use the paraglide-js package directly in v2 or above https://www.npmjs.com/package/@inlang/paraglide-js

# Paraglide-Rollup

This package provides a Rollup plugin to make it easier to use the paraglide-js.

It automatically runs the compiler on build, removing the
need for the `paraglide` commands in your `package.json`.

[Learn more about Paraglide](https://inlang.com/m/gerre34r/library-inlang-paraglideJs)

## Usage
After having set up paraglide-js, you can add this plugin to your rollup config.

```js
// rollup.config.js
import { paraglide } from "@inlang/paraglide-rollup"
export default {
	plugins: [
		paraglide({
			project: "./project.inlang", //Path to your inlang project
			outDir: "./src/paraglide", //Where you want the generated files to be placed
		}),
	]
}
```

Now, the `paraglide` folder at `./src/paraglide` will be automatically updated when you build your project. If you combine this with a watcher, you can rebuild your project whenever you change your messages.

### Setting up an Alias

Since you'll be importing from the `paraglide` folder a lot, it's a good idea to set up an alias for it. This way you won't have to write `../../paraglide` all the time.


You can do this using the `@rollup/plugin-alias` plugin. Install it:

```bash
npm install --save-dev @rollup/plugin-alias
```

And then add it to your rollup config. This example assumes that you're using ESM.

```js
// rollup.config.js
import { paraglide } from "@inlang/paraglide-rollup"
import alias from "@rollup/plugin-alias"
import { fileURLToPath } from "url"

export default {
	plugins: [
		alias({
			entries: {
				// This is the alias you can use in your code
				// you can change it to whatever you want
				$paraglide: fileURLToPath(new URL("./src/paraglide", import.meta.url))
			}
		}),
		paraglide({
			project: "./project.inlang",
			outdir: "./src/paraglide",
		}),
	],
}
```

You can now import your messages from `$paraglide/messages`. But typescript will warn that it can't find the module. To fix this, you need to add the alias to your `tsconfig.json`:

```json
// tsconfig.json
{
	"compilerOptions": {
		"paths": {
			"$paraglide/*": ["src/paraglide/*"]
		}
	}
}
```

Happy Hacking.

## Example

You can find an example project [here](https://github.com/opral/monorepo/tree/main/inlang/source-code/paraglide/paraglide-rollup/example)
npm package: @inlang/paraglide-unplugin
Description: Unplugin Plugin for runnning the Paraglide compiler.
Author: inlang
Latest version: 1.9.5
Deprecated: use the paraglide-js package directly which exports all bundler plugins in v2 and above https://www.npmjs.com/package/@inlang/paraglide-js


# Paraglide-Unplugin

This package provides an Unplugin Wrapper around the paraglide-js compiler, making it 
easier to use with bundler such as Vite, Webpack, Rollup, and RsPack.

[Learn more about Paraglide](https://github.com/opral/monorepo/tree/main/inlang/source-code/paraglide/paraglide-js)

## Usage
It's unlikely that you want to use this package directly. Instead, you should use the version
specific to your bundler. 

- `@inlang/paraglide-vite`
- `@inlang/paraglide-webpack`
- `@inlang/paraglide-rollup`
- `@inlang/paraglide-esbuild`

If you want to use the experimental RsPack bundler, you can use this package directly.

```js
import { paraglide } from "@inlang/paraglide-unplugin";
paraglide.rspack // RsPack Plugin (experimental)
```
npm package: @inlang/paraglide-vite
Description: Vite plugin for running the Paraglide i18n compiler
Author: inlang
Latest version: 1.4.0
Deprecated: the vite plugin is now bundled in the paraglide-js package. please use https://www.npmjs.com/package/@inlang/paraglide-js directly

---
imports: 
  - https://cdn.jsdelivr.net/npm/@opral/markdown-wc-doc-elements/dist/doc-callout.js
---


<doc-callout type="warning">
  Paraglide JS 2.0 bundles the vite plugin. Please use the [Paraglide JS 2.0](https://inlang.com/m/gerre34r/library-inlang-paraglideJs/vite) instead.
</doc-callout>

Paraglide JS 2.0 bundles the vite plugin. Please use the [Paraglide JS 2.0](https://inlang.com/m/gerre34r/library-inlang-paraglideJs/vite) instead.

This package provides a vite plugin to make it easier to use paraglide-js in any project that uses vite.

It automatically runs the compiler on message changes, giving you a seamless experience.
You also no longer need the `paraglide` commands in your `package.json`.

[Learn more about Paraglide](https://inlang.com/m/gerre34r/library-inlang-paraglideJs)

## Usage

First make sure you have set up `@inlang/paraglide-js`. If you haven't you can get started by running
this command and following the instructions.

```bash
npx @inlang/paraglide-js init
```

Install paraglide-vite with

```bash
npm install @inlang/paraglide-vite
```

and add it to your `vite.config.js`

```js
import { defineConfig } from "vite"
import { paraglide } from "@inlang/paraglide-vite"

export default defineConfig({
  plugins: [
    paraglide({
      project: "./project.inlang", //Path to your inlang project
      outdir: "./src/paraglide", //Where you want the generated files to be placed
    }),
  ],
})
```

Now, the `paraglide` folder at `./src/paraglide` will be automatically updated when you change your messages.

## Example

You can find an example vite project [here](https://github.com/opral/monorepo/tree/main/inlang/source-code/paraglide/paraglide-vite/example).
npm package: @inlang/paraglide-webpack
Description: Webpack plugin for running the Paraglide i18n compiler
Author: inlang
Latest version: 1.1.5
Deprecated: use the paraglide-js package directly in v2 or above https://www.npmjs.com/package/@inlang/paraglide-js

# Paraglide-Webpack

This package provides a Webpack plugin to make paraglide easier to use.

It automatically runs the compiler when building, so you no longer need the `paraglide` commands in your `package.json`.

[Learn more about Paraglide](https://inlang.com/m/gerre34r/library-inlang-paraglideJs)

## Usage

After having set up paraglide-js, you can add this plugin to your webpack config.

```js
import Paraglide from "@inlang/paraglide-webpack"

export default {
	plugins: [
		Paraglide({
			project: "./project.inlang",
			outdir: "./src/paraglide",
		}),
	],
}
```

This will run the compiler when webpack builds your project. This will ensure that the generated files in `./src/paraglide` are always up to date.

## Setting up an Alias

Since you will be importing from the `paraglide` folder a lot, it's a good idea to set up an alias for it. This way you won't have to write `../../paraglide` all the time.

In your `webpack.config.js`, add an alias to your `resolve` object:

```js
import { paraglide } from "@inlang/paraglide-webpack"
import path from "path"
import { fileURLToPath } from "url"

const __dirname = path.dirname(fileURLToPath(import.meta.url))

export default {
	resolve: {
		alias: {
			$paraglide: path.resolve(__dirname, "src/paraglide/"),
		},
	},
	plugins: [
		paraglide({
			project: "./project.inlang",
			outdir: "./src/paraglide",
		}),
	],
}
```

You can now import your messages from `$paraglide/messages`. But typescript will warn that it can't find the module. To fix this, you need to add the alias to your `tsconfig.json`:

```json
{
	"compilerOptions": {
		"baseUrl": ".",
		"paths": {
			"$paraglide/*": ["src/paraglide/*"]
		}
	}
}
```

That's it. Happy Hacking.