combine-source
v1.0.4
Published
[![npm package][npm-img]][npm-url] [![Build Status][build-img]][build-url] [![Downloads][downloads-img]][downloads-url] [![Issues][issues-img]][issues-url] [![Code Coverage][codecov-img]][codecov-url] [![Commitizen Friendly][commitizen-img]][commitizen-ur
Readme
combine-source
Overview
combine-source is a TypeScript library designed to combine multiple source files and their corresponding source maps into a single file and source map. This is particularly useful for bundling JavaScript/TypeScript projects where maintaining accurate source maps is crucial for debugging.
Features
- Combine multiple source files into one.
- Merge source maps to maintain accurate mappings.
- Supports both CommonJS and ES Module formats.
Installation
To install the dependencies, use yarn:
yarn install combine-sourceOr use npm:
npm install combine-sourceUsage
Here's an example of how to use the combineSource function:
import { CombineFile, combineSource } from 'combine-source';
const files: CombineFile[] = [
{
code: 'console.log("File 1");',
map: {
/* source map object for file 1 */
},
},
{
code: 'console.log("File 2");',
map: {
/* source map object for file 2 */
},
},
];
const result = combineSource(files);
console.log(result.code); // Combined code
console.log(result.map); // Combined source mapScripts
test: Run tests using Vitest.build: Build the project usingtsup.prepublishOnly: Build the project before publishing.
License
This project is licensed under the MIT License.
Contributing
Contributions are welcome! Please open an issue or submit a pull request.
Contact
For any questions or issues, please open an issue on this repository.
