# Custom template and bundling

**URL:** <https://forum.needle.tools/t/custom-template-and-bundling/1306>\
**Category:** 🌵 Needle Engine\
**Tags:** question\
**Created:** [December 31, 2023, 12:00am UTC](https://forum.needle.tools/t/custom-template-and-bundling/1306 "2023-12-31T00:00:00Z")\
**Posts on this page:** 18\
**Page:** 2

<div class="post-metadata">

**Author:** ![Marcel\_Wiessler1](https://forum.needle.tools/user_avatar/forum.needle.tools/marcel_wiessler1/32/21_2.png) [@Marcel\_Wiessler1](https://forum.needle.tools/u/Marcel_Wiessler1)\
**Post date:** [January 2, 2024, 12:00am UTC](https://forum.needle.tools/t/custom-template-and-bundling/1306/21 "2024-01-02T00:00:00Z")

</div>

Another reason is probably that your dont include the code with type `module`

---

<div class="post-metadata">

**Author:** ![discord-import](https://forum.needle.tools/user_avatar/forum.needle.tools/discord-import/32/33_2.png) [@discord-import](https://forum.needle.tools/u/discord-import)\
**Post date:** [January 4, 2024, 12:00am UTC](https://forum.needle.tools/t/custom-template-and-bundling/1306/22 "2024-01-04T00:00:00Z")

</div>

What code and where I am I including it?

I’ve tried adding `type=module` to the `<needle-component/>`

_by user 285903863339548673_

---

<div class="post-metadata">

**Author:** ![discord-import](https://forum.needle.tools/user_avatar/forum.needle.tools/discord-import/32/33_2.png) [@discord-import](https://forum.needle.tools/u/discord-import)\
**Post date:** [January 5, 2024, 12:00am UTC](https://forum.needle.tools/t/custom-template-and-bundling/1306/23 "2024-01-05T00:00:00Z")

</div>

I’m comparing a lot of this to the React template i.e. pasting it over, so I’m not sure why much more configuration is necessary

_by user 285903863339548673_

---

<div class="post-metadata">

**Author:** ![Marcel\_Wiessler1](https://forum.needle.tools/user_avatar/forum.needle.tools/marcel_wiessler1/32/21_2.png) [@Marcel\_Wiessler1](https://forum.needle.tools/u/Marcel_Wiessler1)\
**Post date:** [January 5, 2024, 12:00am UTC](https://forum.needle.tools/t/custom-template-and-bundling/1306/24 "2024-01-05T00:00:00Z")

</div>

I mean the script include in your root index html

---

<div class="post-metadata">

**Author:** ![discord-import](https://forum.needle.tools/user_avatar/forum.needle.tools/discord-import/32/33_2.png) [@discord-import](https://forum.needle.tools/u/discord-import)\
**Post date:** [January 5, 2024, 12:00am UTC](https://forum.needle.tools/t/custom-template-and-bundling/1306/25 "2024-01-05T00:00:00Z")

</div>

Still no luck, unfortunately!

 ![needle_screenshot.png](https://europe1.discourse-cdn.com/flex006/uploads/needle1/original/2X/c/c7a37b40282006a9167bf33252bd300b8c007009.png)

_by user 285903863339548673_

---

<div class="post-metadata">

**Author:** ![discord-import](https://forum.needle.tools/user_avatar/forum.needle.tools/discord-import/32/33_2.png) [@discord-import](https://forum.needle.tools/u/discord-import)\
**Post date:** [January 10, 2024, 12:00am UTC](https://forum.needle.tools/t/custom-template-and-bundling/1306/26 "2024-01-10T00:00:00Z")

</div>

Hi @Marcel_Wiessler1 🌵, do you have any other ideas/suggestions?

At the moment I still haven’t been able to integrate needle into my own web project set ups, and have relied on the needle templates which isn’t ideal.

Thanks

_by user 285903863339548673_

---

<div class="post-metadata">

**Author:** ![discord-import](https://forum.needle.tools/user_avatar/forum.needle.tools/discord-import/32/33_2.png) [@discord-import](https://forum.needle.tools/u/discord-import)\
**Post date:** [January 21, 2024, 12:00am UTC](https://forum.needle.tools/t/custom-template-and-bundling/1306/27 "2024-01-21T00:00:00Z")

</div>

@Marcel_Wiessler1 🌵 @herbst​:cactus:

Hi, I don’t feel best advised with this - I am a Pro subscriber and so far I don’t feel like the additional cost is reflected in the support

_by user 285903863339548673_

---

<div class="post-metadata">

**Author:** ![hybridherbst](https://forum.needle.tools/user_avatar/forum.needle.tools/hybridherbst/32/3416_2.png) [@hybridherbst](https://forum.needle.tools/u/hybridherbst)\
**Post date:** [January 21, 2024, 12:00am UTC](https://forum.needle.tools/t/custom-template-and-bundling/1306/28 "2024-01-21T00:00:00Z")

</div>

Did you report a bug with your specific project setup already / could you do that? Or just the zip file above?

Please note that „support“ included in Pro doesn’t mean we can do custom work for you, and a Pro license is required for certain usages and revenues, it’s not a „choice“ to use Indie or Pro. As you know we’re always happy to help but there are limits where it becomes essentially custom contract work for very specific usages. As a point of reference, the level of support we’re often giving here — taking a look at user projects and pointing out issues — typically costs between 20k and 250k per year for Unity/Unreal.

As said, would be great if you could please report a bug with repro steps so that we can take a closer look. We certainly want you to succeed.

---

<div class="post-metadata">

**Author:** ![discord-import](https://forum.needle.tools/user_avatar/forum.needle.tools/discord-import/32/33_2.png) [@discord-import](https://forum.needle.tools/u/discord-import)\
**Post date:** [January 21, 2024, 12:00am UTC](https://forum.needle.tools/t/custom-template-and-bundling/1306/29 "2024-01-21T00:00:00Z")

</div>

I certainly don’t expect support to mean project development(!)  
But at the very least I expect the Needle team to reply and give some direction. You can see in this thread that communication abruptly ends

It seems like Needle users go through the same avenue for support, with users getting somewhat equal amounts of assistance - whereas the Pro pricing tier highlights the Priority Support

I have been trying to create a custom web project, using parcel as my bundler, but have encountered issues that seem to point to the needle-engine component.

I am not familiar with bug reports or where to report them

_by user 285903863339548673_

---

<div class="post-metadata">

**Author:** ![hybridherbst](https://forum.needle.tools/user_avatar/forum.needle.tools/hybridherbst/32/3416_2.png) [@hybridherbst](https://forum.needle.tools/u/hybridherbst)\
**Post date:** [January 21, 2024, 12:00am UTC](https://forum.needle.tools/t/custom-template-and-bundling/1306/30 "2024-01-21T00:00:00Z")

</div>

It’s certainly at our discretion what amount of support we give for users that don’t have a valid license – we just happen to be nice people that want our users to succeed 🙂

And, definitely thanks for pinging this thread again – sometimes threads fall “through the cracks”, but not with the intent of abandoning you / the thread.

In Unity you can select “Needle Engine \> Report a bug \> Create Bug Report”, then a file will pop up where you can add more info

---

<div class="post-metadata">

**Author:** ![Marcel\_Wiessler1](https://forum.needle.tools/user_avatar/forum.needle.tools/marcel_wiessler1/32/21_2.png) [@Marcel\_Wiessler1](https://forum.needle.tools/u/Marcel_Wiessler1)\
**Post date:** [January 23, 2024, 12:00am UTC](https://forum.needle.tools/t/custom-template-and-bundling/1306/31 "2024-01-23T00:00:00Z")

</div>

@BOTBOT please update to parcel 2 to fix the issue - it’s related to parcel 1 not being able to handle ESM modules. You can find an upgrade guide here: [Migration](https://parceljs.org/getting-started/migration)

---

<div class="post-metadata">

**Author:** ![Marcel\_Wiessler1](https://forum.needle.tools/user_avatar/forum.needle.tools/marcel_wiessler1/32/21_2.png) [@Marcel\_Wiessler1](https://forum.needle.tools/u/Marcel_Wiessler1)\
**Post date:** [January 23, 2024, 12:00am UTC](https://forum.needle.tools/t/custom-template-and-bundling/1306/32 "2024-01-23T00:00:00Z")

</div>

I basically only changed the import to module as mentioned before `<script type="module" src="index.tsx"></script>`

---

<div class="post-metadata">

**Author:** ![Marcel\_Wiessler1](https://forum.needle.tools/user_avatar/forum.needle.tools/marcel_wiessler1/32/21_2.png) [@Marcel\_Wiessler1](https://forum.needle.tools/u/Marcel_Wiessler1)\
**Post date:** [January 23, 2024, 12:00am UTC](https://forum.needle.tools/t/custom-template-and-bundling/1306/33 "2024-01-23T00:00:00Z")

</div>

Package.json `"parcel": "^2.0.0"`

---

<div class="post-metadata">

**Author:** ![Marcel\_Wiessler1](https://forum.needle.tools/user_avatar/forum.needle.tools/marcel_wiessler1/32/21_2.png) [@Marcel\_Wiessler1](https://forum.needle.tools/u/Marcel_Wiessler1)\
**Post date:** [January 23, 2024, 12:00am UTC](https://forum.needle.tools/t/custom-template-and-bundling/1306/34 "2024-01-23T00:00:00Z")

</div>

and

```tsx
import "@needle-tools/engine";
import "./generated/gen.js"

import { NeedleEngineAttributes } from "@needle-tools/engine";
import React, { ReactElement, useRef } from 'react'
  
export function NeedleEngine(props: NeedleEngineAttributes | { children?: any }): ReactElement<NeedleEngineAttributes> {
    return <needle-engine {...props}>
        {props.children}
    </needle-engine>;
}

```

![Capto_Capture_2024-01-23_11-28-11_PM.png](https://europe1.discourse-cdn.com/flex006/uploads/needle1/original/2X/d/d63df6e6a6421414ad0a1a6e8fa0e31f82ac98fd.png)

---

<div class="post-metadata">

**Author:** ![Marcel\_Wiessler1](https://forum.needle.tools/user_avatar/forum.needle.tools/marcel_wiessler1/32/21_2.png) [@Marcel\_Wiessler1](https://forum.needle.tools/u/Marcel_Wiessler1)\
**Post date:** [January 23, 2024, 12:00am UTC](https://forum.needle.tools/t/custom-template-and-bundling/1306/35 "2024-01-23T00:00:00Z")

</div>

the only thing I havent figured out yet is how to get parcel to serve the “assets” folder as well - perhaps you know more about that (including folders or where the assets folder needs to be in the project)

---

<div class="post-metadata">

**Author:** ![Marcel\_Wiessler1](https://forum.needle.tools/user_avatar/forum.needle.tools/marcel_wiessler1/32/21_2.png) [@Marcel\_Wiessler1](https://forum.needle.tools/u/Marcel_Wiessler1)\
**Post date:** [January 23, 2024, 12:00am UTC](https://forum.needle.tools/t/custom-template-and-bundling/1306/36 "2024-01-23T00:00:00Z")

</div>

Modified `start` to copy the assets folder which seems to do the trick:  
`"start": "cp -R ./assets ./dist/assets && parcel src/index.html"`  
hope this helps you [Copy all files from a predefined folder into the dist folder · Issue #1411 · parcel-bundler/parcel · GitHub](https://github.com/parcel-bundler/parcel/issues/1411#issuecomment-415483965)

---

<div class="post-metadata">

**Author:** ![Marcel\_Wiessler1](https://forum.needle.tools/user_avatar/forum.needle.tools/marcel_wiessler1/32/21_2.png) [@Marcel\_Wiessler1](https://forum.needle.tools/u/Marcel_Wiessler1)\
**Post date:** [January 26, 2024, 12:00am UTC](https://forum.needle.tools/t/custom-template-and-bundling/1306/37 "2024-01-26T00:00:00Z")

</div>

@BOTBOT did you have a chance yet to try this?

---

<div class="post-metadata">

**Author:** ![discord-import](https://forum.needle.tools/user_avatar/forum.needle.tools/discord-import/32/33_2.png) [@discord-import](https://forum.needle.tools/u/discord-import)\
**Post date:** [January 26, 2024, 12:00am UTC](https://forum.needle.tools/t/custom-template-and-bundling/1306/38 "2024-01-26T00:00:00Z")

</div>

Thanks for looking into this and testing it out. I haven’t tried just yet but it looks promising

_by user 285903863339548673_

[Previous page](https://forum.needle.tools/t/custom-template-and-bundling/1306.md?page=1)
