0.1.1 • Published 7 years ago

@tririga/tri-fix-import v0.1.1

Weekly downloads
1
License
MIT
Repository
-
Last release
7 years ago

tri-fix-import

Convert Node-style named import specifiers to relative import paths that can be used in the UX framework. Example 1: A component file (component-sample1.js) located inside the folder component-sample1 and that has an import like: import { Base } from '@polymer/polymer/polymer-legacy.js';

The import will be converted to:
import { Base } from '../@polymer/polymer/polymer-legacy.js';

Example 2: A component file (component-sample2.js) located inside the folder @tririga/component-sample2 and that has an import like: import { Base } from '@polymer/polymer/polymer-legacy.js';

The import will be converted to:
import { Base } from '../../@polymer/polymer/polymer-legacy.js';

Installation

$ npm install @tririga/tri-fix-import -g

Synopsis

$ tri-fix-import -d <list of directories>

Options

  • -d, --dirs directory_path The directory path(s) that contains the javascript files. Defaults to the current directory path.
  • --version print tri-deploy version.
  • --help print this message.

Usage

Convert the javascript files located in the current directory:

$ tri-fix-import

Convert the javascript files located in the node_modules and triplat directories:

$ tri-fix-import -d ./node_modules ./triplat