Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

client ts files and server ts files should compile to diffrent target #294

Open
clysto opened this issue Jun 30, 2020 · 3 comments
Open

Comments

@clysto
Copy link

clysto commented Jun 30, 2020

In the tsconfig.json:

{
    "compilerOptions": {
        "module": "commonjs",
        "esModuleInterop": true,
        "allowSyntheticDefaultImports": true,

        /* ----------there---------- */
        "target": "es6",  

        "noImplicitAny": true,
        "moduleResolution": "node",
        "sourceMap": true,
        "outDir": "dist",
        "baseUrl": ".",
        "paths": {
            "*": [
                "node_modules/*",
                "src/types/*"
            ]
        }
    },
    "include": [
        "src/**/*"
    ]
}

Es6 is not supported for some browsers. I think we should compile the frontend code and the backend code separately.

@peterblazejewicz
Copy link
Collaborator

Yes, that correct and valid point, if we keep the IE11 as supported target, not for evergreens. I think this is outside of this template focus I believe, to provide fine tuned client side compilation tooling. But someone could propose solution based on the simple RollupJS config for client code (Rollup + TS support plugin exporting to ES5 UMD).

@diberry
Copy link
Collaborator

diberry commented Aug 20, 2020

@peterblazejewicz I was thinking about separation of concerns too. It might be easier to contribute without sidetracking if the community knew what the goals and roadmap are. There is a bit of cleanup and updating that could happen...

@peterblazejewicz
Copy link
Collaborator

The tsconfig now suppports this layered confguration, so we could have base/server/client and differnt targets in package.json scripts. How does it sounds? The regular client code without the introduction of ES6 complex imports, compiles just fine with tsc, no other tooling required.
I'm not thinking about composite projects, for the sake of the simplicity:
https://www.typescriptlang.org/docs/handbook/project-references.html

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants