babel-plugin-atom-demand

babel plugin for import atom on demand

Usage no npm install needed!

<script type="module">
  import babelPluginAtomDemand from 'https://cdn.skypack.dev/babel-plugin-atom-demand';
</script>

README

babel-plugin-atom-demand

NPM version NPM downloads

babel plugin for import vue-atom-ui on demand

Install

babel-plugin-atom-demand

Example

Converts

import Atom from 'vue-atom-ui';
import { Button } from 'vue-atom-ui';

(roughly) to

var _atom = require('vue-atom-ui/lib/Atom');

var _atom2 = _interopRequireDefault(_atom);

var _button = require('vue-atom-ui/lib/Button');

var _button2 = _interopRequireDefault(_button);

require('vue-atom-ui/lib/css/button.css');

Usage

npm install babel-plugin-atom-demand --save-dev

Via .babelrc or babel-loader.

{
  "plugins": ["atom-demand"]
}

Note

babel-plugin-atom-demand will be not working if you add the vue-atom-ui in webpack config vender