open-index/open-npm huggingface dataset:
npm package: @inlang/paraglide-js-adapter-rollup
Description: Rollup adapter for Paraglide.js
Author: inlang
Latest version: 1.0.46
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# Paraglide Adapter 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-js-adapter-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-js-adapter-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-js-adapter-rollup/example)
npm package: @inlang/paraglide-js-adapter-unplugin
Description: Unplugin adapter for Paraglide.js
Author: inlang
Latest version: 1.4.29
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.


# Paraglide Adapter 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-js-adapter-vite`
- `@inlang/paraglide-js-adapter-webpack`
- `@inlang/paraglide-js-adapter-rollup`
- `@inlang/paraglide-js-adapter-esbuild`

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

```js
import { paraglide } from "@inlang/paraglide-js-adapter-unplugin";
paraglide.rspack // RsPack Plugin (experimental)
```
npm package: @inlang/paraglide-js-adapter-vite
Description: Vite adapter for Paraglide.js
Author: inlang
Latest version: 1.2.40
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# Paraglide Adapter Vite

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 the vite adapter with

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

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

```js
import { defineConfig } from "vite"
import { paraglide } from "@inlang/paraglide-js-adapter-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-js-adapter-vite/example).
npm package: @inlang/paraglide-js-adapter-webpack
Description: Webpack adapter for Paraglide.js
Author: inlang
Latest version: 1.0.46
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# Paraglide Adapter 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-js-adapter-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-js-adapter-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.