babel-plugin-mithril-add-data-attribute
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -7,8 +7,5 @@ "use strict"; | ||
exports.default = babelPluginMithrilComponentDataAttrs; | ||
exports.testTransform = void 0; | ||
var _path = require("path"); | ||
var _babelCore = require("babel-core"); | ||
const DATA_ATTRIBUTE = "data-component"; | ||
@@ -223,25 +220,2 @@ | ||
}; | ||
} // used for test and development | ||
const testTransform = (code, pluginOptions = {}, transformOptions = {}) => { | ||
var _result$code; | ||
if (!code) { | ||
return ""; | ||
} | ||
const result = (0, _babelCore.transform)(code, { | ||
babelrc: false, | ||
plugins: [babelPluginMithrilComponentDataAttrs, pluginOptions], | ||
parserOpts: { | ||
plugins: [] | ||
}, | ||
...transformOptions | ||
}); | ||
return ((_result$code = result.code) === null || _result$code === void 0 ? void 0 : _result$code.trim()) || ""; | ||
}; | ||
exports.testTransform = testTransform; | ||
const test = testTransform("const MyComponent = () => m('div');"); | ||
test; | ||
} |
{ | ||
"name": "babel-plugin-mithril-add-data-attribute", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Babel plugin adds attributes to m() components - intended for development. Helps debug - find your components in a large repo. Adds component name and file to component data attributes which will be visible in the generated HTML.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
8635
184