rollup-plugin-template-string-optimize
Advanced tools
+13
-8
@@ -1,5 +0,9 @@ | ||
| import acorn from 'acorn'; | ||
| import escodegen from 'escodegen'; | ||
| const isObject = (item) => Object.prototype.toString.call(item) === '[object Object]'; | ||
| const acornOptions = { | ||
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| var acorn = require("acorn"); | ||
| var escodegen = require("escodegen"); | ||
| var isObject = function (item) { | ||
| return Object.prototype.toString.call(item) === '[object Object]'; | ||
| }; | ||
| var acornOptions = { | ||
| sourceType: 'module' | ||
@@ -12,3 +16,3 @@ }; | ||
| else if (isObject(input)) { | ||
| for (let key in input) { | ||
| for (var key in input) { | ||
| if (typeof input[key] === 'string') { | ||
@@ -23,7 +27,7 @@ input[key] = input[key].replace(/(\n\s+)/g, ''); | ||
| } | ||
| export default function (options) { | ||
| function default_1(options) { | ||
| return { | ||
| name: 'template-string-optimize', | ||
| transform(code) { | ||
| const tree = acorn.parse(code, acornOptions); | ||
| transform: function (code) { | ||
| var tree = acorn.parse(code, acornOptions); | ||
| traverse(tree); | ||
@@ -34,1 +38,2 @@ return escodegen.generate(tree); | ||
| } | ||
| exports.default = default_1; |
+1
-1
| { | ||
| "name": "rollup-plugin-template-string-optimize", | ||
| "version": "1.0.0", | ||
| "version": "1.0.1", | ||
| "description": "template string optimize plugin for rollup", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
+2
-2
@@ -1,3 +0,3 @@ | ||
| import acorn from 'acorn' | ||
| import escodegen from 'escodegen' | ||
| import acorn = require('acorn') | ||
| import escodegen = require('escodegen') | ||
@@ -4,0 +4,0 @@ const isObject = (item: any): boolean => |
+1
-2
| { | ||
| "compilerOptions": { | ||
| "target": "esnext", | ||
| "module": "es6", | ||
| "target": "es5", | ||
| "moduleResolution": "node", | ||
@@ -6,0 +5,0 @@ "outDir": "lib", |
6286
1.9%89
4.71%