@knot/webpack-plugin
TypeScript icon, indicating that this package has built-in type declarations

1.10.0 • Public • Published

@knot/webpack-plugin

npm code style: prettier lerna semantic-release Commitizen friendly standard-readme compliant

CircleCI

A webpack plugin to automatically handle parsing and transforming knot code.

Integrate knot into your existing webpack build easily using this plugin.

Table of Contents

Install

npm install @knot/webpack-plugin
# or
yarn add @knot/webpack-plugin

Usage

In order to use knot modules with webpack only requires 2 pieces of configuration.

  1. Add '.kn' to the list of extensions to consider when resolving modules
  2. Add an instance of the KnotPlugin to the list of plugins
// webpack.config.js
import KnotPlugin from '@knot/webpack-plugin';

module.exports = {
  // add these to your existing configuration

  resolve: {
    extensions: ['.kn', '.js']
  },

  plugins: [
    new KnotPlugin({
      // optionally print an exhaustive log of the operation of the compiler
      // debug: true,
    })
  ]
};

You will now be able to import a .kn file from any normal javascript file. When running webpack, these files will be automatically converted into native javascript modules.

There is also a more robust example.

Maintainers

@effervescentia

Contributing

PRs accepted.

Small note: If editing the README, please conform to the standard-readme specification.

License

MIT © 2019 Ben Teichman

Readme

Keywords

none

Package Sidebar

Install

npm i @knot/webpack-plugin

Weekly Downloads

2

Version

1.10.0

License

MIT

Unpacked Size

33.5 kB

Total Files

20

Last publish

Collaborators

  • effervescentia