Skip to content

importing jquery as a global library causes typescript code importing jquery to transpile as a blank object #2923

Closed
@shahmirn

Description

@shahmirn

Please provide us with the following information:

OS?

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

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.18
node: 4.4.5
os: win32 x64

Repro steps.

Was this an app that wasn't created using the CLI? What change did you do on your code? etc.

add "../node_modules/jquery/dist/jquery.js" to angular-cli.json

Have a typescript file import * as $ from "jquery";

The log given by the failure.

Normally this include a stack trace and some more information.

Results in code in main.js like:
var $ = webpack_require(209);

Pasting webpack_require(209) in the browser's console results in it returning Object {}

Mention any other details that might be useful.


Thanks! We'll be in touch soon.

Metadata

Metadata

Assignees

Labels

P1Impacts a large percentage of users; if a workaround exists it is partial or overly painfulneeds: investigationRequires some digging to determine if action is needed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions