Comments (3)
Alternative solution would be to implement @kitsonk's idea in this issue. The deno_graph
's createGraph
API copied almost verbatim would work well (the load
and resolve
options).
from deno_emit.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.
from deno_emit.
This will work once #114 lands with the following code:
import { transpile } from "https://deno.land/x/emit/mod.ts";
const sources = new Map(Object.entries({
"file:///index.js": "import ok from 'external/test.js';\nok();",
"https://example.com/test.js":
"export default function ok() { console.log('ok'); }",
}));
await transpile(new URL("file:///index.js"), {
importMap: {
imports: {
"external/": "https://example.com/",
},
},
async load(specifier) {
const source = sources.get(specifier);
if (source === undefined) {
throw new Error("Unexpected specifier");
}
return {
kind: "module",
specifier,
content: source,
};
},
});
from deno_emit.
Related Issues (20)
- npm:specifier support HOT 1
- Inconsistent behavior regarding sourcemaps with tsc and deno bundle HOT 3
- Should `deno_emit` output ignore comments like `deno bundle`? HOT 1
- import not working offline, requires wasm HOT 2
- Please provide a way to generate .d.ts file
- Uncaught SyntaxError: Identifier 'mod' has already been declared
- error: Uncaught (in promise) Error: Unable to output during bundling. HOT 11
- Trailing slash added to base URL in transpile load function specifier HOT 4
- Uncaught ReferenceError: Deno is not defined HOT 1
- Better debugging output HOT 1
- Option to type check TypeScript? HOT 3
- Rust API?
- Provide option to avoid tree walking during transpilation HOT 3
- How to make bare import external? HOT 4
- Multiple `const mod =` definitions? HOT 3
- "Remote modules are not allowed to import local modules" HOT 3
- Cancellable API HOT 1
- feature request: output typescript
- Bundle fails when js deps include node modules
- `deno_emit::bundle_graph` only bundles the first root of `ModuleGraph`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deno_emit.