Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

TypeScript projects are getting JavaScript webpack.config #716

@DimitarTachev

Description

@DimitarTachev

Environment

  • CLI: next
  • nativescript-dev-webpack: ~0.18.0

Describe the bug
We don't have the typescript dependency hardcoded in our templates anymore and we depend on the nativescript-dev-typescript postinstall script to generate it.

It seems that npm is executing the postintalls script in alphabetical order and the nativescript-dev-typescript plugin is generating the typescript dependency before the postintall script of nativescript-dev-webpack. In this way, everything is working as expected.

However, when the NativeScript CLI is used with yarn instead of npm, the postinstall scripts are run in parallell and the nativescript-dev-webpack plugin is copying the javascript webpack.config instead of the typescript one because the typescript dependency is still missing.

To Reproduce

  1. npm i nativescript@next -g
  2. tns package-manager set yarn
  3. tns create typescriptBug --ts (the webpack plugin postinstall will copy the JavaScript templated instead of the TypeScript one)
  4. tns run --bundle

Expected behavior
The app should run properly instead of getting "ERROR in Entry module not found: Error: Can't resolve './app.js' in '/typescriptBug/app'"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions