babel-plugin-ignore-html-and-css-imports

0.1.0 • Public • Published

Ignore html and css imports in your code. Useful for testing meteor without it's context

Example

import html from './example.html';

out

Installation

$ npm install --save-dev babel-plugin-ignore-html-and-css-imports

Usage

Via .babelrc (Recommended)

.babelrc

{
  "plugins": ["ignore-html-and-css-imports"]
}

Via CLI

$ babel --plugins ignore-html-and-css-imports script.js

Via Node API

require("babel-core").transform("code", {
  plugins: ["transform-ignore-html-and-css-imports"]
});

Options

You can configure what extensions to remove by adding an optional removeExtensions option.

{
  "plugins": [
    [
      "ignore-html-and-css-imports",
      {
        "removeExtensions": [".png"]
      }
    ]
  ]
}

Initially based on yeiniel/babel-plugin-transform-html-import-to-string which turned out still not to work properly in Meteor - and since we didn't need the string at all, we've decided to change it a bit.

Package Sidebar

Install

npm i babel-plugin-ignore-html-and-css-imports

Weekly Downloads

12,855

Version

0.1.0

License

MIT

Unpacked Size

3.91 kB

Total Files

9

Last publish

Collaborators

  • lgandecki