Socket
Socket
Sign inDemoInstall

karma-esbuild-next

Package Overview
Dependencies
40
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    karma-esbuild-next

ESBuild preprocessor for karma test runner


Version published
Weekly downloads
247
decreased by-18.48%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

karma-esbuild

An esbuild preprocessor for the karma test runner. The main benefits of esbuild is speed and readability of the compiled output.

Installation

npm install --save-dev karma-esbuild-next

Usage

Add esbuild as your preprocessor inside your karma.conf.js:

module.exports = function (config) {
	config.set({
		preprocessors: {
			// Add esbuild to your preprocessors
			"test/**/*.test.js": ["esbuild"],
		},
	});
};

Advanced: Custom configuration

A custom esbuild configuration can be passed via an additional property on karma's config. Check out the documentation for esbuild for available options.

module.exports = function (config) {
	config.set({
		preprocessors: {
			// Add esbuild to your preprocessors
			"test/**/*.test.js": ["esbuild"],
		},

    plugins: [
      "karma-esbuild-next",
    ],

		esbuild: {
			// Replace some global variables
			define: {
				COVERAGE: coverage,
				"process.env.NODE_ENV": JSON.stringify(process.env.NODE_ENV || ""),
				ENABLE_PERFORMANCE: true,
			},
			plugins: [createEsbuildPlugin()],

			// Karma-esbuild specific options
			singleBundle: true, // Merge all test files into one bundle(default: true)
		},
	});
};

License

MIT, see the LICENSE file.

Fork

This project was forked from https://github.com/marvinhagemeister/karma-esbuild/

Keywords

FAQs

Last updated on 01 May 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc