An open API service indexing awesome lists of open source software.

https://github.com/kanocomputing/es6-resolution

Transforms your named ES6 Imports into resolved paths
https://github.com/kanocomputing/es6-resolution

Last synced: over 1 year ago
JSON representation

Transforms your named ES6 Imports into resolved paths

Awesome Lists containing this project

README

          

# ES6 names resolution for servers

Transforms your named ES6 Imports into resolved paths, allowing a browser to fetch the dependencies.

## Usage

```js
const resolve = require('@kano/es6-resolution');

const body = `
import { Utils } from '@acme/my-lib/lib/utils.js';

`;

const upgradedBody = resolve(body, 'application/javascript', __dirname + '/index.js');
```
Will be translated to
```js
import { Utils } from '../../node_modules/@acme/my-lib/lib/utils.js';
```

Browsers will be happy and no code compilation is needed