babichjacob / sapper-firebase-typescript-graphql-tailwindcss-actions-template

A template that includes Sapper for Svelte, Firebase functions and hosting, TypeScript and TypeGraphQL, Tailwind CSS, ESLint, and automatic building and deployment with GitHub Actions
MIT License
106 stars 14 forks source link

Specify that the package uses ES6 #7

Closed benmccann closed 4 years ago

benmccann commented 4 years ago

This will enforce that ES6 syntax is used and that no require statements sneak back in

babichjacob commented 4 years ago

This won't work because Sapper's generated files use CommonJS:

(node:78315) ExperimentalWarning: The ESM module loader is experimental.
file:///.../sapper-firebase-typescript-graphql-tailwindcss-actions-template/__sapper__/dev/server/server.js:3
Object.defineProperty(exports, '__esModule', { value: true });
                      ^

ReferenceError: exports is not defined
    at file:///.../sapper-firebase-typescript-graphql-tailwindcss-actions-template/__sapper__/dev/server/server.js:3:23
    at ModuleJob.run (internal/modules/esm/module_job.js:110:37)
    at async Loader.import (internal/modules/esm/loader.js:164:24)
> Server crashed
benmccann commented 4 years ago

Thanks for testing! I had a patched version of Sapper that fixed that, but thought it worked either way. I guess I'll have to get my patch into Sapper first