Skip to content

jQuery not found in prod build #1413

@rkralston

Description

@rkralston

Please provide us with the following information:

  1. OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)
    Win10
  1. Versions. Please run ng --version. If there's nothing outputted, please
    run in a Terminal:
    node --version
    And paste the result here.
    angular-cli: 1.0.0-beta.10
    node: 6.1.0
    os: win32 x64
  2. Repro steps. Was this an app that wasn't created using the CLI? What change did you
    do on your code? etc.
    Loading jQuery as a 3rd partly library, references in components fail.

npm i jquery --save

typings install dt~jquery --global --save
angular-cli-build.js:
'jquery/dist/jquery.min.+(js|map)',

system-config.js:

const map: any = { 'jquery': 'vendor/jquery/dist/' };

const packages: any = { 'jquery': { defaultExtension: 'js', main: 'jquery.min.js', format: 'cjs' } };

app.component.ts:
import * as jquery from 'jquery'; . . . console.log(jquery); . . . jQuery('#input');

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

  2. Mention any other details that might be useful.
    https://github.com/rkralston/test-app


    Thanks! We'll be in touch soon.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions