Created
September 20, 2017 07:36
-
-
Save lgandecki/41624e804ac631edb7e1ec373e61efa3 to your computer and use it in GitHub Desktop.
remove importing html plugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = function (_ref) { | |
var t = _ref.types; | |
return { | |
visitor: { | |
ImportDeclaration: { | |
exit: function exit(path, state) { | |
var node = path.node; | |
if (endsWith(node.source.value, '.html')) { | |
console.log("inside here"); | |
console.log("Gandecki node.specifiers[0]", node.specifiers); | |
} | |
if (endsWith(node.source.value, '.html')) { | |
path.remove(); | |
} | |
} | |
} | |
} | |
}; | |
}; | |
var _fs = require('fs'); | |
var _fs2 = _interopRequireDefault(_fs); | |
var _path = require('path'); | |
var _path2 = _interopRequireDefault(_path); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
function endsWith(str, search) { | |
return str.indexOf(search, str.length - search.length) !== -1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment