Skip to content

Warnings for short imports are shown for browser code #4458

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rosen-vladimirov opened this issue Mar 20, 2019 · 0 comments
Closed

Warnings for short imports are shown for browser code #4458

rosen-vladimirov opened this issue Mar 20, 2019 · 0 comments
Assignees
Labels
Milestone

Comments

@rosen-vladimirov
Copy link
Contributor

Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

  • CLI: 5.2.4
  • Cross-platform modules: Not applicable
  • Android Runtime: Not applicable
  • iOS Runtime: Not applicable
  • Plugin(s): Not applicable

Describe the bug
In my application I have some browser specific code, that is not loaded in the NativeScript app itself, but during tns run <platform> I receive warnings that this code has short imports.

To Reproduce

  1. tns create myApp
  2. cd myApp/app
  3. touch file1.js
  4. Open file1.js and add the following content:
o.cache&&(r+="&cache="+u(o.cache)),t=["<!DOCTYPE html>","<html>","<head>",'<meta charset="UTF-8" />','<script type="text/javascript">',"   var UWA = {hosts:"+n(e.hosts)+"},",'       curl = {apiName: "require"}
  1. Run tns run android

You'll see warning from CLI for the short import.

Another way to reproduce the behavior is by downloading the UWA_Standalone_Alone.js and place it inside app dir, as described here

Expected behavior
CLI must show warnings only for real short imports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants