Webpack loader that imports scripts as URLs for use with worklet modules (AudioWorklet, PaintWorklet, AnimationWorklet, etc.). Version 2.0.0 is the latest stable release. It is explicitly a fork of worker-loader and the maintainer advises caution as worker-specific behaviors may break worklets. Only works with webpack 3 or 4. No active development; likely obsolete once worker-loader supports worklets natively. Supports inline as Blob, custom filenames, and public path overrides.
npm install worklet-loaderVerified import paths — ran on the pinned version, not inferred.
Configures webpack to process .worklet.js files with worklet-loader, then imports a worklet file and registers it with AudioWorklet.
Use worker-loader if you need worklet support, or wait for official worklet support.
Use webpack 4 or consider an alternative loader for webpack 5.
Add a custom declaration file (e.g., typings/custom.d.ts) with declare module '*.worklet.ts' { const exportString: string; export default exportString; }Avoid inline: true if your site has strict CSP, or adjust CSP to allow blob: URLs.
Ensure your webpack config has a rule with test: /\.worklet\.js$/ and loader: 'worklet-loader'. Or use inline loader syntax: import url from 'worklet-loader!./file.js';
Run npm install --save-dev worklet-loader