0.1.4 • Published 5 years ago

inline-import.macro v0.1.4

Weekly downloads
1
License
ISC
Repository
github
Last release
5 years ago

inline-import.macro

Downloads Version Babel Macro

The Problem

You want use a veriable once inline, but you have to import it at top of the file.

The Solution

This is a babel-plugin-macro which allows you import file inline.

Installation

This module is distributed via npm which is bundled with node and should be installed as one of your project's devDependencies:

npm install --save-dev inline-import.macro

Usage

Once you've configured babel-plugin-macro you can import/require inline-import.macro.

Here are a few before/after examples:

import importPage from 'inline-import.macro';
const routes = [
  importPage('./aa'),
  importPage('./bb'),
  importPage('./cc'),
  importPage('./dd'),
];
import _dd from "./dd";
import _cc from "./cc";
import _bb from "./bb";
import _aa from "./aa";
const routes = [
  _aa,
  _bb,
  _cc,
  _dd]
;
0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago