Skip to content

Importing adhoc 3rd party lib fail #845

@derailed

Description

@derailed

Please provide us with the following information:

  1. OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)

angular-cli: 1.0.0-beta.4
node: 5.7.0
os: darwin x64

  1. Versions. Please run ng --version. If there's nothing outputted, please
    run in a Terminal:
    node --version
    And paste the result here.
  2. Repro steps. Was this an app that wasn't created using the CLI? What change did you
    do on your code? etc.

App created with ng-cli

1 - npm install phoenix_js --save

2 - Update system-config.ts

const map: any = {
"phoenix_js": "vendor/phoenix_js/dist/phoenix.js"
};

const packages: any = {
"phoenix_js": {
"format": "cjs",
"defaultExtension": "js",
"main": "index",
}

3 - Update angular-cli-build.js

module.exports = function(defaults) {
return new Angular2App(defaults, {
vendorNpmFiles: [
...
'phoenix_js/dist/phoenix.js',
]
});
};

4 - Update main.ts

import { Socket } from 'phoenix_js'

  1. The log given by the failure. Normally this include a stack trace and some
    more information.

Error: Typescript found the following errors:
./tmp/broccoli_type_script_compiler-in
main.ts (6, 24): Cannot find module 'phoenix_js'.
at BroccoliTypeScriptCompiler._doIncrementalBuild (./node_modules/angular-cli/lib/broccoli/broccoli-typescript.js:115:19)
at BroccoliTypeScriptCompiler.build (./node_modules/angular-cli/lib/broccoli/broccoli-typescript.js:43:10)

...

  1. Mention any other details that might be useful.

    Thanks! We'll be in touch soon.

I did see the post about integrating 3rdparty libs but only includes moment and material -> No help for adhoc thirdparty lib inclusions.

Stuck! Thanks for your help.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions