|
|
@ -152,7 +152,12 @@ function cjs(
|
|
|
|
|
|
|
|
|
|
|
|
const internal_globals = get_internal_globals(globals, helpers);
|
|
|
|
const internal_globals = get_internal_globals(globals, helpers);
|
|
|
|
|
|
|
|
|
|
|
|
const user_requires = imports.map(node => ({
|
|
|
|
const user_requires = imports.map(node => {
|
|
|
|
|
|
|
|
const init = x`require("${edit_source(node.source.value, sveltePath)}")`;
|
|
|
|
|
|
|
|
if (node.specifiers.length === 0) {
|
|
|
|
|
|
|
|
return b`${init};`;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return {
|
|
|
|
type: 'VariableDeclaration',
|
|
|
|
type: 'VariableDeclaration',
|
|
|
|
kind: 'const',
|
|
|
|
kind: 'const',
|
|
|
|
declarations: [{
|
|
|
|
declarations: [{
|
|
|
@ -171,9 +176,10 @@ function cjs(
|
|
|
|
kind: 'init'
|
|
|
|
kind: 'init'
|
|
|
|
}))
|
|
|
|
}))
|
|
|
|
},
|
|
|
|
},
|
|
|
|
init: x`require("${edit_source(node.source.value, sveltePath)}")`
|
|
|
|
init
|
|
|
|
}]
|
|
|
|
}]
|
|
|
|
}));
|
|
|
|
};
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
const exports = module_exports.map(x => b`exports.${{ type: 'Identifier', name: x.as }} = ${{ type: 'Identifier', name: x.name }};`);
|
|
|
|
const exports = module_exports.map(x => b`exports.${{ type: 'Identifier', name: x.as }} = ${{ type: 'Identifier', name: x.name }};`);
|
|
|
|
|
|
|
|
|
|
|
|