Launch Week Day 5: Introducing Reachability for PHP.Learn More
Socket
Book a DemoSign in
Socket

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

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-ignore-html-and-css-imports - npm Package Compare versions

Comparing version
0.0.1
to
0.0.2
+30
.history/package_20170922185252.json
{
"name": "babel-plugin-ignore-html-and-css-imports",
"version": "0.0.2",
"description": "Ignore html and css imports in your code. Useful for testing meteor without it's context",
"main": "lib/index.js",
"scripts": {
"build": "babel src --out-dir lib --copy-files",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/lgandecki/babel-plugin-ignore-html-and-css-imports.git"
},
"keywords": [
"babel-plugin",
"html",
"import",
"string"
],
"author": "Łukasz Gandecki",
"license": "MIT",
"bugs": {
"url": "https://github.com/lgandecki/babel-plugin-ignore-html-and-css-importsissues"
},
"homepage": "https://github.com/lgandecki/babel-plugin-ignore-html-and-css-imports#readme",
"devDependencies": {
"babel-cli": "^6.4.0",
"babel-preset-es2015": "^6.3.13"
}
}
+2
-8

@@ -15,10 +15,4 @@ 'use strict';

var node = path.node;
if (endsWith(node.source.value, '.html')) {
var dir = _path2.default.dirname(_path2.default.resolve(state.file.opts.filename));
var absolutePath = _path2.default.resolve(dir, node.source.value);
var html = _fs2.default.readFileSync(absolutePath, "utf8");
path.replaceWith(t.variableDeclaration("var", [t.variableDeclarator(t.identifier(node.specifiers[0].local.name), t.stringLiteral(html))]));
if (endsWith(node.source.value, '.html') || endsWith(node.source.value, '.scss') || endsWith(node.source.value, '.css')) {
path.remove();
}

@@ -25,0 +19,0 @@ }

+1
-1
{
"name": "babel-plugin-ignore-html-and-css-imports",
"version": "0.0.1",
"version": "0.0.2",
"description": "Ignore html and css imports in your code. Useful for testing meteor without it's context",

@@ -5,0 +5,0 @@ "main": "lib/index.js",