Comments (4)
Side note: since I could not make it work with Vite I used esbuild
and @luca/esbuild-deno-loader in the meantime, you can see it in this repo: dldc-packages/canvas.
But I would much prefer to be able to use Vite as it's a more common setup and requires less tinkering than Esbuild.
from deno.
seconding this, because esbuild doesnt seem to support my use case. I am trying to use jsr packages in a svelte web app. Attempting to use this loader in tandem with the svelte plugin seems to not be possible
import * as esbuild from "npm:[email protected]";
import sveltePlugin from "npm:esbuild-svelte";
// Import the WASM build on platforms where running subprocesses is not
// permitted, such as Deno Deploy, or when running without `--allow-run`.
// import * as esbuild from "https://deno.land/x/[email protected]/wasm.js";
import { denoPlugins } from "jsr:@luca/esbuild-deno-loader@^0.10.3";
const result = await esbuild.build({
plugins: [
sveltePlugin({
preprocess: denoPlugins({
configPath: './deno.json'
}),
}),
],
mainFields: ["svelte", "browser", "module", "main"],
conditions: ["svelte", "browser"],
entryPoints: ["./src/main.ts"],
outfile: "./dist/server.esm.js",
bundle: true,
format: "esm",
logLevel: "info",
});
console.log(result.outputFiles);
esbuild.stop();
Depending on which plugin I declare first, Ill get [ERROR] Expected a JavaScript or TypeScript module, but identified a Unknown module. Importing these types of modules is currently not supported.
or [ERROR] Could not resolve
for jsr packages. I believe the current recommended way to use jsr packages in svelte is by installing them into a node modules folder with npx jsr
and use --byonm,
but I have struggled to get this working too
from deno.
just an update on this point:
I believe the current recommended way to use jsr packages in svelte is by installing them into a node modules folder with npx jsr and use --byonm, but I have struggled to get this working too
I was able to get vite + jsr working by just fully using npm to handle node_modules management. E.g.
deno run -A create-vite --template svelte-ts
npm install
npx jsr add @andykais/ts-rpc
it still feels bad that nodejs is necessary to develop vite on deno, but this at least will let me develop (besides dependency management) and build for production in deno
from deno.
Also experienced that issue, while I was building a project with Deno, Vite, TailwindCSS, shadcn/ui
- managed to get all these working with Deno, but it seems that JSR (which is the official place where Deno hosts its standard library now) is not usable with Vite at the moment, because Vite dependent on node_modules
, and if package is not from npm - it wouldn't be visible to Vite running with Deno?
E.g. I could not to use @std/dotenv
with Vite in the project
(off-topic: I also failed to use Deno.env.get
with Vite, but perhaps it's my stupidity)
P. S. there are a few attempts to build vite plugin for deno, e.g. vite-deno-plugin - but it's limited to esm.sh
from deno.
Related Issues (20)
- Bug: LSP is missing "Convert to ESM" quick fix
- SUGGEST: Auto-Complete For The Configuration File `"imports"`
- Lint: Add a rule for Node built ins not having the `node:` prefix HOT 1
- Add back warning when importing remote package with same name as workspace package
- Bug: `deno install` panics with `package.json` + `@latest` HOT 1
- Using --allow-ffi leads to "unexpected argument" and --unstable-ffi leads to prompt HOT 4
- ERR_UNSUPPORTED_ESM_URL_SCHEME importing jsr package in npm package via `jsr:` scheme HOT 2
- npm:bcrypt doesn't work properly in Deno
- tracking: complete runtime documentation
- Implement crypto.hash
- Provide an easier way to configure type checking for other runtimes
- LSP incorrectly gives error on npm imports when there is no package.json or deno.json HOT 2
- `deno add` - dist tags don't work
- error: Uncaught (in promise) TypeError: Relative import path "<npm-package>" not prefixed with / or ./ or ../ (from another NPM package) HOT 1
- REPL is broken by RegExp literal with character class containing quotes
- `FormData` from `<input type=file>` with no file selected gives inconsistent results in browser vs Deno (empty file vs empty string) HOT 1
- Bug: panic when using `latest` or other tags as version in `package.json` HOT 1
- Feat: Add support for network tab in DevTools HOT 1
- thread 'main' panicked at cli/tools/upgrade.rs:657:3: HOT 2
- npm:@temporalio/client doesn't work properly in Deno HOT 2
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.