-
-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import ... -> ... is not defined #164
Comments
Hi @j2l, I'm sorry for letting this issue sit for so long without response. I had actually started to respond but needed to fix some bugs before I could get this working. Response I started with webpack instructions (don't use)It looks like three.js doesn't ship with For now, it probably makes sense to use a bundler like webpack outside of plenti's build process.
const path = require('path');
module.exports = {
entry: './node_modules/three/src/Three.js',
output: {
path: path.resolve(__dirname, 'assets'),
filename: 'bundle.js',
},
};
<script type="module" src="/assets/bundle.js"></script> Then in between the import * as THREE from '/assets/bundle.js'; However doing this ^ gives me an error along these lines:
That's because Plenti is seeing the named import to a locally referenced file and is trying to turn it into a "component signature" that we use internally to identify things in V8. I actually still need to fix this bug, so for now it's probably better to import directly from NPM and with the gopack updates I made in v0.4.28 you should be able to pull threejs in now. I made some updates to "gopack" which provides esm support for the project, so now you should be able to import * as THREE from 'three'; Here's a working example site demonstrating this:
Note: Just make sure you use the newest release v0.4.28 to get this working |
Hi Jim,
I successfully run svelte and three (not svelthree here), but for any reason working code in index.svelte like:
plenti serve throws:
What does Go need?
Thanks :)
The text was updated successfully, but these errors were encountered: