Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node module imports renamed with underscores #928

Closed
Chase-Silk opened this issue Oct 24, 2018 · 3 comments
Closed

Node module imports renamed with underscores #928

Chase-Silk opened this issue Oct 24, 2018 · 3 comments

Comments

@Chase-Silk
Copy link

Node modules are being renamed from:
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
to:
goog.require('_.._angular.platform_browser_dynamic');
and cant be found by Google Closure Compiler.

Slashes become dots and dashes become underscores. The @ is removed and prefixed with _.._

Is there a way to preserve node_module imports exclusively, or avoid renaming imports entirely?

tsickle script: tsickle --typed --externs=./externs.js -- --lib es2015,es6,dom

tsconfig.json:

{
  "compileOnSave": false,
  "compilerOptions": {
    "sourceMap": true,
    "declaration": false,
    "moduleResolution": "node",
    "module": "commonjs",
    "emitDecoratorMetadata": true,
    "noEmitHelpers": true,
    "experimentalDecorators": true,
    "noImplicitAny": true,
    "suppressImplicitAnyIndexErrors": true,
    "strict": true,
    "strictPropertyInitialization": false,
    "target": "es5",
    "typeRoots": [
      "node_modules/@types"
    ],
    "lib": [
      "es6",
      "es2015",
      "dom"
    ]
  },
  "include": [
    "js/**/*.ts"
  ]
}

Dependencies:

"dependencies": {
    "@angular/common": "^6.1.9",
    "@angular/compiler": "^6.1.9",
    "@angular/core": "^6.1.9",
    "@angular/platform-browser": "^6.1.9",
    "@angular/platform-browser-dynamic": "^6.1.9",
    "@angular/upgrade": "^6.1.9",

    "rxjs": "^6.3.3"
  },
  "devDependencies": {
    "@types/angular": "^1.6.6",
    "@types/angular-resource": "^1.5.14",
    "angular-mocks": "^1.6.10",
    "clang-format": "^1.1.1",
    "google-closure-compiler": "^20171112.0.0",
    "google-closure-library": "^20171112.0.0",
    "karma-closure": "github:nckh/karma-closure",
    ...
    "tsickle": "^0.33.0",
    "typescript": "^2.7.2"
  }
@evmar
Copy link
Contributor

evmar commented Oct 24, 2018

@alexeagle

@mprobst
Copy link
Contributor

mprobst commented Oct 24, 2018 via email

@evmar
Copy link
Contributor

evmar commented Jul 8, 2019

This is another instance of the general 'cannot work with node_modules libraries' problem, in #1041 .

@evmar evmar closed this as completed Jul 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants