'Is it possible to transpile/bundle/transform code and resolve most of its references?
Given two input files, values.js and index.js, is it possible to resolve code references in order to obtain the code described in output.js?
Note that the desired output is not the evaluated code, but simply a string with resolved references.
// values.js
export const values = {
aFunction: () => { },
aDate: new Date(1644318966754),
}
// index.js
import { values } from './values'
const otherValues = {
aSymbol: Symbol('foo'),
aString: new String("A String object"),
}
const allValues = {
...values,
...otherValues,
}
// output.js
const allValues = {
aFunction: () => { },
aDate: new Date(1644318966754),
aSymbol: Symbol('foo'),
aString: new String("A String object"),
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
