ng2-daterange-picker icon indicating copy to clipboard operation
ng2-daterange-picker copied to clipboard

Remove *.ts files from src during publishing to npm

Open papuche opened this issue 7 years ago • 0 comments

During compilation I have the errors

ERROR in [at-loader] TS6059: File '.../node_modules/ng2-daterange-picker/index.ts' is not under 'rootDir' '.../src/app'. 'rootDir' is expected to contain all source files.

ERROR in [at-loader] TS6059: File '.../node_modules/ng2-daterange-picker/src/ang.calendar.ts' is not under 'rootDir' '.../src/app'. 'rootDir' is expected to contain all source files.

ERROR in [at-loader] TS6059: File '.../node_modules/ng2-daterange-picker/src/ang.datepicker.component.ts' is not under 'rootDir' .../src/app'. 'rootDir' is expected to contain all source files.

ERROR in [at-loader] TS6059: File '.../node_modules/ng2-daterange-picker/src/ang.daterange.picker.component.ts' is not under 'rootDir' '.../src/app'. 'rootDir' is expected to contain all source files.

ERROR in [at-loader] TS6059: File '.../node_modules/ng2-daterange-picker/src/daterange.picker.module.ts' is not under 'rootDir' '.../src/app'. 'rootDir' is expected to contain all source files.

My configuration is:

// tsconfig.json
{
  "compilerOptions": {
    "target": "es5",
    "module": "es2015",
    "lib": ["es2015", "dom"],
    "moduleResolution": "node",
    "declaration": true,
    "noImplicitAny": false,
    "sourceMap": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "outDir": "./build",
    "rootDir": "./src/app",
    "skipLibCheck": true,
    "typeRoots": ["./node_modules/@types"],
    "strictNullChecks": true,
    "importHelpers": true
  },
  "exclude": [
    "node_modules",
    "dist",
    "**/*.ngfactory.ts",
    "**/*.shim.ts",
    "src/app/main*.ts",
    "src/app/polyfill.ts"
  ]
...
}

I have found some similar issues here and here. It seems you need to compile your projet before publish to npm.

  • angular 4.3.0
  • typescript 2.4.1

papuche avatar Jul 27 '17 09:07 papuche