@jetbrains/kotlin-webpack-plugin

Kotlin plugin for webpack

Stats

StarsIssuesVersionUpdatedCreatedSize
@jetbrains/kotlin-webpack-plugin
2,408133.0.22 years ago4 years agoMinified + gzip package size for @jetbrains/kotlin-webpack-plugin in KB

Readme

kotlin-webpack-plugin

This package allows compiling Kotlin files to JavaScript using webpack.

Installation

npm i @jetbrains/kotlin-webpack-plugin --save-dev

Requirements

This plugin requires a minimum of Node v8.6.0 and Webpack v4.0.0. To use this plugin with Webpack v3.0.0, you need to use v1.2.11 of this plugin.

Usage

Example of webpack configuration:

const KotlinWebpackPlugin = require('@jetbrains/kotlin-webpack-plugin');

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

  resolve: {
    // "kotlin_build" is the build output directory
    modules: ['kotlin_build', 'node_modules']
  },

  // [OPTIONAL] To enable sourcemaps, source-map-loader should be configured
  module: {
    rules: [
      {
        test: /\.js$/,
        include: path.resolve(__dirname, '../kotlin_build'),
        exclude: [
          /kotlin\.js$/, // Kotlin runtime doesn't have sourcemaps at the moment
        ],
        use: ['source-map-loader'],
        enforce: 'pre'
      }
    ]
  },

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

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

You can find a sample configuration in the example folder.

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.