Skip to content

Warnings for short imports are shown for browser code #4458

Closed
@rosen-vladimirov

Description

@rosen-vladimirov

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.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions