Open lvanderbijl opened 7 years ago
this seems to be the same as #50
I had similar problem with importing uirouter/angular-hybrid. Try adding paths object to rollupBaseConfig object in build.js file located in root of library, i.e.
const rollupBaseConfig = {
moduleName: camelCase(libName),
sourceMap: true,
globals: {
'@angular/core': 'ng.core'
},
external: [
'@angular/core'
],
paths: {
'applicationinsights-js/index': 'applicationinsights-js'
},
plugins: [
sourcemaps()
]
};
My similar problem in issue #50 was solved by adding paths: { 'xxx/index': 'xxx' } in rollup config. Thank you @adamlubek for this.
Hi,
I'm using applicationinsights as a dependency for an angular library I'm creating.
I'm using applicationinsights 1.0.4 and the typings v1.0.4.
I'm using applicationinsights in a service like this (typescript file): import { AppInsights } from 'applicationinsights-js';
However when the compiler converts it to an es2015 module, the import becomes: import { AppInsights } from 'applicationinsights-js/index'; (note the extra: /index at the end)
which is obviously wrong and breaks. Any ideas why this is occuring? I feel like it's something to do with the way the @types works but can't work out why.
Here's a sample of the tsconfig I'm using (tsconfig.es5.json)
Note that I added types and typeroots but it doesn't seem to make any difference.
Thanks for your time Leander