Made a project template for Typescript + Parcel

39 views
Skip to first unread message

DaVince

unread,
Feb 9, 2020, 12:18:08 PM2/9/20
to excaliburjs
I was previously using the Webpack template for my project, but the sheer amount of setup and small issues I kept running into led me to looking into alternatives. I found Parcel, a zero-config bundler, and decided to create a project template around it.


Some notes:

- I've included a default index.html in the src folder, which Parcel uses as its entry point.
- I handle asset inclusion by using the parcel-plugin-static-files-copy plugin, which copies src/assets to dist(-dev)/assets if found. This plugin is configured under the "staticFiles" section in package.json.
- The assets are not transformed in any way.
- Source mapping is turned on and fully functional.

Hope this will be useful to anyone else wanting to quick start a project. :)

Erik Onarheim

unread,
Feb 9, 2020, 12:35:28 PM2/9/20
to DaVince, excaliburjs
This is fantastic! Thanks for making this!

If it's alright with you, we may want to list this template with other getting started info in our documentation.

--
You received this message because you are subscribed to the Google Groups "excaliburjs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to excaliburjs...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/excaliburjs/1a25e380-6367-4525-8070-f176f2003e68%40googlegroups.com.

DaVince

unread,
Feb 9, 2020, 2:57:39 PM2/9/20
to excaliburjs
That's fine with me, glad it's helpful!

Op zondag 9 februari 2020 11:35:28 UTC-6 schreef Erik Onarheim:
This is fantastic! Thanks for making this!

If it's alright with you, we may want to list this template with other getting started info in our documentation.

On Sun, Feb 9, 2020 at 11:18 AM DaVince <vincen...@gmail.com> wrote:
I was previously using the Webpack template for my project, but the sheer amount of setup and small issues I kept running into led me to looking into alternatives. I found Parcel, a zero-config bundler, and decided to create a project template around it.


Some notes:

- I've included a default index.html in the src folder, which Parcel uses as its entry point.
- I handle asset inclusion by using the parcel-plugin-static-files-copy plugin, which copies src/assets to dist(-dev)/assets if found. This plugin is configured under the "staticFiles" section in package.json.
- The assets are not transformed in any way.
- Source mapping is turned on and fully functional.

Hope this will be useful to anyone else wanting to quick start a project. :)

--
You received this message because you are subscribed to the Google Groups "excaliburjs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to excal...@googlegroups.com.

DaVince

unread,
Feb 16, 2020, 12:22:56 PM2/16/20
to excaliburjs
I have since noticed that Parcel isn't able to properly generate a sourcemap for Excalibur itself; it only does so for my game's own scripts. Parcel emits the following warning:

⚠️  Could not load existing sourcemap of "../node_modules/excalibur/dist/excalibur.min.js".

I'm considering submitting a report about it on the Parcel repo, but I also wanted to report this here, just in case someone might happen to know why it's saying this.

Op zondag 9 februari 2020 20:57:39 UTC+1 schreef DaVince:

DaVince

unread,
May 1, 2020, 7:13:08 AM5/1/20
to excaliburjs
I updated this to use Excalibur 0.24.1 and it seems to have gotten rid of the sourcemap issue.
Reply all
Reply to author
Forward
0 new messages