1.0.10 • Published 11 months ago

karma-requirejs-esm-preprocessor v1.0.10

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

karma-requirejs-esm-preprocessor

Latest version Dependency status

Karma preprocessor for converting ES modules to AMD in RequireJS projects. Uses requirejs-esm-preprocessor.

Synopsis

module.exports = config => config.set({
  preprocessors: {
    'src/**/*.js': ['requirejs-esm']
  },
  requirejsEsmPreprocessor: {
    isScript: path => !path.includes('/test/'),
    sourceMap: true
  }
})

Installation

This module can be installed in your project using NPM, PNPM or Yarn. Make sure, that you use Node.js version 14 or newer.

npm i -D karma-requirejs-esm-preprocessor
pnpm i -D karma-requirejs-esm-preprocessor
yarn add karma-requirejs-esm-preprocessor

Configuration

isScript(path: string): boolean

Allows further filtering the files before passing them to the preprocessor. If the patterns are inconvenient to specify what files should be preprocessed, a simple pattern can be used to capture all files and the final filtering be done by isScript returning true only for the paths to files which need preprocessing. The default is undefined - no extra filtering.

sourceMap: boolean

Enables an inline source map in the preprocessed output to support debugging in the browser. The default is true.

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Lint and test your code.

License

Copyright (c) 2022-2023 Ferdinand Prantl

Licensed under the MIT license.

1.0.10

11 months ago

1.0.9

12 months ago

1.0.8

12 months ago

1.0.7

12 months ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago