question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Import path of third-party library is rewritten from `openlayers` to `openlayers/index`

See original GitHub issue

Type of Issue

  • Bug Report
  • Feature Request

Description

I have a module MapModule that is using openlayers 3 library, so in map.component.ts I have import * as ol from 'openlayers';

When I run packagr, rollup compiles files with the following line: import { Map, View, control, format, layer, proj, source } from 'openlayers/index';

i.e. it adds /index at the end, when it should be just openlayers

This issue is related to rollup.js, here is the url that is related to this problem: https://github.com/angular/angular/issues/16084

To fix this issue: I need access to “annotateForClosureCompiler” property so it can be set to false. At this moment it’s part of tsconfig.ngc.json and it set to true by default. Would it be possible to extend packagr so that I can fiddle with tsconfig properties via ng-package.json file?

Thanks Alex

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
adjioevcommented, Sep 7, 2017

This is my current ng-package.json

{
  "$schema": "./node_modules/ng-packagr/ng-package.schema.json",
  "lib": {
    "entryFile": "public_api.ts",
    "externals": {
      "@ngrx/store": "@ngrx/store",
      "openlayers": "openlayers",
      "openlayers/index": "openlayers"
    }
  }
}

but packagr still producess the following line import { Map, View, control, format, layer, proj, source } from 'openlayers/index';

0reactions
github-actions[bot]commented, Jun 19, 2020

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

This action has been performed automatically by a bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

bug: rollup inlines external dependency because import path ...
The import path from @ngx-translate/core in the source was re-written to @ngx-translate/core/index , thus the externals mapping does not match and rollup ...
Read more >
3rd party - OpenLayers
Library Description Maintainer OL‑Cesium Cesium integration library. OpenLayers ol‑mapbox‑style Create OpenLayers maps from Mapbox Style objects. OpenLayers OL‑LayerSwitcher Layer control for OpenLayers. Matt Walker
Read more >
Import from in Openlayers - javascript - GIS Stack Exchange
Let's see an example. Typical OpenLayers example. One very simple example of OpenLayers could be (separated in two files):. index.html <!DOCTYPE ...
Read more >
Use openlayers with typescript project - Stack Overflow
The way you import has changed - do not use the ol namespace. Import the types explicitly: import { Map } from 'ol';...
Read more >
OpenLayers - ArcGIS Developers
OpenLayers is an open source JavaScript library that renders interactive maps from map tiles and vector data. This guide shows you how to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found