0

I am trying to implement a custom JS library that I have written into a TypeScript Ionic 2 project. I have no typings because I wrote it myself.

For that I changed my tsconfig to

{
  "compilerOptions": {
    "allowSyntheticDefaultImports": true,
    "declaration": false,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "lib": [
      "dom",
      "es2015"
    ],
    "module": "es2015",
    "moduleResolution": "node",
    "sourceMap": true,
    "target": "es5",
    "allowJs": true
  },
  "include": [
    "src/**/*"
  ],
  "exclude": [
    "node_modules"
  ],
  "compileOnSave": false,
  "atom": {
    "rewriteTsconfig": false
  }
}

after that I get the following errors in console (let's ignore the metamask line, it's from a plugin):

screenshot

Also I have tried changing the outDir in compile options without success.

Any ideas or should I switch to vanillaJs?

mchl18
  • 2,119
  • 12
  • 20
  • Also I should mention that "www/build" folder only contains polyfill.js and sw-toolbox.js after the change. Also the compiler says "[15:37:23] typescript error Cannot write file '...' because it would overwrite input file." for the new js files. – mchl18 Aug 28 '17 at 13:41
  • workaround is to add the `js` in `src/assets/js` and include it in your `index.html` or inject it – Ivar Reukers Aug 28 '17 at 14:50

1 Answers1

0

I just realized it was all atop a node library and i forgot that, will need to set a server up for this to work.

mchl18
  • 2,119
  • 12
  • 20