# kotlin-webpack-plugin

> Kotlin plugin for webpack

Latest version **1.0.8** (published 2017-10-09) · Apache-2.0 license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install kotlin-webpack-plugin
pnpm add kotlin-webpack-plugin
yarn add kotlin-webpack-plugin
bun add kotlin-webpack-plugin
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.8 |
| Published | 2017-10-09 |
| First published | 2017-06-08 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=6 |
| Dependencies | 6 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2464 |
| Author | Andrey Skladchikov |
| Maintainers | jetbrains-buildserver, princed, huston007 |
| Keywords | Webpack, Kotlin |

## Links

- npm: https://www.npmjs.com/package/kotlin-webpack-plugin
- Repository: https://github.com/JetBrains/create-react-kotlin-app
- Homepage: https://github.com/JetBrains/create-react-kotlin-app#readme
- Issues: https://github.com/JetBrains/create-react-kotlin-app/issues
- npm.io page: https://npm.io/package/kotlin-webpack-plugin

## Dependencies (6)

- [glob](https://npm.io/package/glob.md) 7.1.2
- [globby](https://npm.io/package/globby.md) 6.1.0
- [fs-extra](https://npm.io/package/fs-extra.md) 3.0.1
- [kotlinc-js](https://npm.io/package/kotlinc-js.md) ^1.1.1
- [read-dir-files](https://npm.io/package/read-dir-files.md) ^0.1.1
- [kotlin-compiler](https://npm.io/package/kotlin-compiler.md) 1.1.51

## Alternatives

- [raw-loader](https://npm.io/package/raw-loader.md) — 4.3M weekly downloads
- [plop](https://npm.io/package/plop.md) — 1.4M weekly downloads
- [webpack-deadcode-plugin](https://npm.io/package/webpack-deadcode-plugin.md) — 80.3K weekly downloads
- [@storybook/preact-vite](https://npm.io/package/@storybook/preact-vite.md) — 54.2K weekly downloads
- [vite-plugin-transform](https://npm.io/package/vite-plugin-transform.md) — 2.4K weekly downloads

## Recent versions

- 1.0.8 (latest) — 2017-10-09
- 1.0.7 — 2017-10-06
- 1.0.6 — 2017-10-04
- 1.0.5 — 2017-06-30
- 1.0.4 — 2017-06-28
- 1.0.3 — 2017-06-22
- 1.0.2 — 2017-06-20
- 1.0.1 — 2017-06-09
- 1.0.0 — 2017-06-08

## README

# kotlin-webpack-plugin

A webpack plugin that compiles Kotlin sources

## Installation

```bash
npm i kotlin-webpack-plugin --save-dev
```

## Usage

Example of webpack configuration:
```js
const KotlinWebpackPlugin = require('../plugin');

module.exports = {
  entry: 'kotlinApp', // kotlinApp is the default module name

  resolve: {
    // "kotlin_build" is where the compiled Kotlin code (kotlinApp.js) is outputted
    modules: ['node_modules', 'kotlin_build']
  },

  // [OPTIONAL] To enable sourcemaps, source-map-loader should be configured
  module: {
    rules: [
      {
        test: /\.js$/,
        include: path.resolve(__dirname, '../kotlin_build'),
        use: ['source-map-loader'],
        enforce: 'pre',
      },
    ],
  },

  output: {
    path: __dirname + '/build',
    filename: 'build.js',
  },

  plugins: [
    new KotlinWebpackPlugin({
      src: __dirname + '/src',
    })
  ]
};
```

Also see [example](./example).

---
_Source: https://npm.io/package/kotlin-webpack-plugin · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
