Merott / nativescript-pdf-view

A basic PDF viewer plugin for NativeScript. Now maintained by @madmas: github.com/madmas/nativescript-pdf-view
Other
32 stars 35 forks source link

[Webpack] Unable to compile using webpack #16

Closed echap closed 7 years ago

echap commented 7 years ago

The plugin is not usable with webpack, maybe the package.json should be updated ?

{
  "_args": [
    [
      {
        "raw": "nativescript-pdf-view@^1.2.1",
        "scope": null,
        "escapedName": "nativescript-pdf-view",
        "name": "nativescript-pdf-view",
        "rawSpec": "^1.2.1",
        "spec": ">=1.2.1 <2.0.0",
        "type": "range"
      },
      "/home/eric-hubup/projects/hubup-nativescript-ivy"
    ]
  ],
  "_from": "nativescript-pdf-view@>=1.2.1 <2.0.0",
  "_id": "nativescript-pdf-view@1.2.1",
  "_inCache": true,
  "_location": "/nativescript-pdf-view",
  "_nodeVersion": "5.12.0",
  "_npmOperationalInternal": {
    "host": "packages-12-west.internal.npmjs.com",
    "tmp": "tmp/nativescript-pdf-view-1.2.1.tgz_1486825626805_0.6759080195333809"
  },
  "_npmUser": {
    "name": "merott",
    "email": "npm@merott.com"
  },
  "_npmVersion": "3.8.6",
  "_phantomChildren": {},
  "_requested": {
    "raw": "nativescript-pdf-view@^1.2.1",
    "scope": null,
    "escapedName": "nativescript-pdf-view",
    "name": "nativescript-pdf-view",
    "rawSpec": "^1.2.1",
    "spec": ">=1.2.1 <2.0.0",
    "type": "range"
  },
  "_requiredBy": [
    "/"
  ],
  "_resolved": "https://registry.npmjs.org/nativescript-pdf-view/-/nativescript-pdf-view-1.2.1.tgz",
  "_shasum": "7ce2c02f52b714723da0de369d9685d5c9733143",
  "_shrinkwrap": null,
  "_spec": "nativescript-pdf-view@^1.2.1",
  "_where": "/home/eric-hubup/projects/hubup-nativescript-ivy",
  "author": {
    "name": "Merott Movahedi",
    "email": "merott@merott.com"
  },
  "bugs": {
    "url": "https://github.com/Merott/nativescript-pdf-view/issues"
  },
  "dependencies": {},
  "description": "A NativeScript plugin to display PDF files on iOS and Android",
  "devDependencies": {
    "@semantic-release/condition-codeship": "1.1.0",
    "@semantic-release/release-notes-generator": "2.0.0",
    "semantic-release": "6.3.2",
    "tns-core-modules": "2.5.0",
    "tns-platform-declarations": "2.5.0",
    "tslint": "4.4.2",
    "typescript": "2.1.6"
  },
  "directories": {},
  "dist": {
    "shasum": "7ce2c02f52b714723da0de369d9685d5c9733143",
    "tarball": "https://registry.npmjs.org/nativescript-pdf-view/-/nativescript-pdf-view-1.2.1.tgz"
  },
  "gitHead": "18ac92ce3db4237f9e1b34428e9e547e8b9126ec",
  "homepage": "https://github.com/Merott/nativescript-pdf-view",
  "keywords": [
    "NativeScript",
    "JavaScript",
    "Android",
    "iOS",
    "PDF",
    "View"
  ],
  "license": "MIT",
  "main": "src/plugin.js",  // This main is incorrect
  "maintainers": [
    {
      "name": "merott",
      "email": "npm@merott.com"
    }
  ],
  "name": "nativescript-pdf-view",
  "nativescript": {},
  "optionalDependencies": {},
  "readme": "ERROR: No README data found!",
  "release": {
    "generateNotes": "./node_modules/@semantic-release/release-notes-generator",
    "verifyConditions": [
      "./node_modules/@semantic-release/condition-codeship"
    ]
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/Merott/nativescript-pdf-view.git"
  },
  "scripts": {
    "build": "tsc",
    "build:watch": "tsc --watch",
    "demo.android": "npm run preparedemo && cd demo && tns run android",
    "demo.ios": "npm run preparedemo && cd demo && tns emulate ios",
    "preparedemo": "npm run build && cd demo && tns plugin remove nativescript-pdf-view && tns plugin add .. && tns install",
    "prepublish": "npm run build",
    "semantic-release": "semantic-release pre && npm publish && ./node_modules/.bin/semantic-release post",
    "setup": "npm install && cd demo && npm install && cd .. && npm run build && cd demo && tns plugin add .. && cd .."
  },
  "version": "1.2.1"
}
imaginationcoder commented 7 years ago

+1 getting below error while bundling with web-pack

ERROR in ./pages/kid/forms-and-docs/form.or.doc.webview.component.ts
Module not found: Error: Can't resolve 'nativescript-pdf-view' in '/Users/maisapride7/workspace/KIDSAPP/tingr-ns-app/app/pages/kid/forms-and-docs'
 @ ./pages/kid/forms-and-docs/form.or.doc.webview.component.ts 12:0-32
 @ ./app.module.ngfactory.ts
 @ ./main.aot.ts
imaginationcoder commented 7 years ago

@Merott can you please help me on above for web-pack bundle

Merott commented 7 years ago

I believe any webpack bundling issues should be resolved in the just released version 2.