Skip to content

incoming Safari 10.1 module support #14861

@gertcuykens

Description

@gertcuykens

I'm experimenting with Safari 10.1 and so far looking good, I am so happy to get rid of /// <amd-module name="i_hate_doing_this"/> and all the requirejs shenanigans

Basically you just do

<script type="module" src="scripts/index.js"></script>

in your html and we are in es2015 module world, FINALLY!

now the me starting to panic part, Safari 10.1 wants import './menuelement.js'; not import 'menuelement';

Went trough https://www.typescriptlang.org/docs/handbook/module-resolution.html and I didn't notice mention of this.

Suggestion a new module mode named es2015.js that just replaces import 'menu' to import './menu.js' on compile time. PS also notice the required ./ part not only .js

{
  "compileOnSave": true,
  "compilerOptions": {
    "target": "es2017",
    "module": "es2015.js", <========
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true,
    "strictNullChecks": true,
    "noImplicitThis": true,
    "noImplicitAny": true,
    "noImplicitReturns": true,
    "sourceMap": true,
    "lib": [
      "es2017",
      "dom"
    ]
  }
}

PS I made a working Safari 10.1+ demo at https://github.com/gertcuykens/mollie-api-go Com'on TypeScript don't let me down on this, we are this close to getting rid of the webpack familie.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateAn existing issue was already created

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions