quentinlampin / ngx-openlayers

Angular2+ components for Openlayers 4.x
Mozilla Public License 2.0
137 stars 98 forks source link

Importing issue #19

Closed FallenRiteMonk closed 7 years ago

FallenRiteMonk commented 7 years ago

I'm using angular-cli for my project and never had a problem importing this library:

...
import { AngularOpenlayersModule } from 'angular2-openlayers';
...
@NgModule({
  imports: [
    ...,
    AngularOpenlayersModule
]
...

but since angular-cli beta 22 it no longer works. I get the following error:

Error: Unexpected value 'AngularOpenlayersModule' imported by the module '<MODULE_NAME>'

I don't know exactly if this is a problem with angular-cli or with this library, so please have a look at it or let me know if you have no time/idea, then I'll create a issue at the angular-cli repo.

quentin-ol commented 7 years ago

Sorry, I'm kinda swamped today. I will look into this tomorrow.

So, if I understand well (otherwise correct me):

Thanks again, your help is much appreciated !

FallenRiteMonk commented 7 years ago

You are correct in all 3 points, with the little extra to say that beta 22 didn't adopt AOT but made it default (on purpose or not) https://github.com/angular/angular-cli/issues/3368.

Still I think it is important to generally be AOT compliant and also angular-cli complient, since I thing/guess the cli will be the future default boilerplate for angular2 apps and AOT because I'd rater decline this library then AOT since it gave me a extreme performance boost on one of my apps (Loading time form 10sec to 2sec, with no other changes then just compiling using AOT)

quentin-ol commented 7 years ago

I believe this issue is solved, could you double-check and close it ?

FallenRiteMonk commented 7 years ago

Sorry I was on the road for a few days, so I couldn't test. I saw you merged everything so I tried importing version 0.4.1 from npm and tried running it with aot, but the map stayed blank.

I don't know exactly what the problem now is, but I'll have a look and let you know. In the mean while could you please tell me exactly what procedure you run in order to publish on npm.

quentin-ol commented 7 years ago

I'm using the npm publish command. The complete workflow is given here: https://docs.npmjs.com/getting-started/publishing-npm-packages

FallenRiteMonk commented 7 years ago

Do you have to run npm run prepublish befror npm publish or is that automatically done like with npm pack?

quentin-ol commented 7 years ago

Hey! No need to run prepublish prior to npm publish as it takes care of it. Here is the output of npm publish:

$[edited...]npm publish

> angular2-openlayers@0.4.2 prepublish /[edited...]/angular2-openlayers
> ngc

+ angular2-openlayers@0.4.2
quentin-ol commented 7 years ago

Closing as angular2-openlayers is now AOT compliant. Feel free to reopen if need be