0

I have one requirement where I am installing @PDFTron package. Along with the import I have reference the path inside .ts file,for that the files should be in the assets. I am trying to copy files from glob but its working. Can anybody help me in this issue.? code is as below.

angular.json

"assets": [{
              "glob": "**/*",
              "input": "../node_modules/@pdftron/webviewer",
              "output": "src/assets"
            },"src/favicon.ico", "src/assets"],

app.component.ts

WebViewer(
      {
        path: "../assets/lib/webviewer/public"
    }).then(...)

Its not copying files.Please whats the issue in the code of angular.json

  • If you scaffolded your app with the Angular CLI then your `angular.json` file should be on the same level as your `node_modules` folder. Have you tried changing your `input` path to just `"node_modules/@pdftron/webviewer"`? – tomcek112 Apr 24 '20 at 07:57
  • Yes they are on same level.I tried with "node_modules/@pdftron/webviewer". "assets": [{ "glob": "**/*", "input": "node_modules/@pdftron/webviewer", "output": "src/assets" },"src/favicon.ico", "src/assets"], hard luck it didn't work. – SHANKAR KONNUR Apr 24 '20 at 10:02
  • 1
    Its working now.I misunderstood this configuration.It will work on build drop. and there also input : is relative to the workspace root. output is relative to outDir (dist/project-name default). So I used like "assets": [{ "glob": "**/*", "input": "node_modules/@pdftron/webviewer", "output": "/assets/lib" },"src/favicon.ico", "src/assets"], – SHANKAR KONNUR Apr 24 '20 at 10:51

0 Answers0