Socket
Book a DemoInstallSign in
Socket

@sakuli/rollup-hooks

Package Overview
Dependencies
Maintainers
1
Versions
213
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sakuli/rollup-hooks

provide test script preprocessing with rollup

latest
Source
npmnpm
Version
3.0.0
Version published
Weekly downloads
5
400%
Maintainers
1
Weekly downloads
 
Created
Source

@sakuli/rollup-hooks

TLDR;

This is a essential Part of Sakuli which handles the preprocessing of Testfiles. It is usually not nesseccary for Sakuli-Endusers to have any knowledge about the internals of this package.

Usage

This package provdies a preset that implements the following lifecycle hooks:

  • readFileContent
  • requestContext

It is required by @sakuli/legacy but can also be used (and considered) as the default file transformer for any Sakuli extension.

The basic task is to take a given test-file and bundle it together with it's dependencies into a single script-string. Sakuli will than create a Script-Object from this source.

As the name of this package tells, Rollup does the heavy lifting of the bundling process. There is not much magic in this process. Some points are still interesting:

  • It enables Sakuli to use ES6-Modules
  • The output format is commonjs, in order to work properly with external required modules sakuli also injects the require function from its scope.
  • If the extension of the provided file is .ts or .tsx the plugin rollup-plugin-typescript2 is added as a plugin

Keywords

rollup

FAQs

Package last updated on 10 Feb 2022

Did you know?

Socket

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