From 7c11ffce1e158db484dc6882bb29968381505204 Mon Sep 17 00:00:00 2001 From: Gianluca Guarini Date: Sun, 24 Apr 2016 18:44:13 +0200 Subject: [PATCH] updated: using umd export for the tmpl.csp file --- dist/csp.tmpl.js | 9 ++++++--- package.json | 4 ++-- rollup.config.js | 2 +- test/runner.js | 2 +- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/dist/csp.tmpl.js b/dist/csp.tmpl.js index 3f12d04..172beae 100644 --- a/dist/csp.tmpl.js +++ b/dist/csp.tmpl.js @@ -1,5 +1,8 @@ -(function (exports) { - 'use strict'; +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (factory((global.cspTmpl = global.cspTmpl || {}))); +}(this, function (exports) { 'use strict'; var __commonjs_global = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : this; function __commonjs(fn, module) { return module = { exports: {} }, fn(module, module.exports, __commonjs_global), module.exports; } @@ -6938,4 +6941,4 @@ exports.brackets = brackets; exports.tmpl = tmpl; -}((this.cspTmpl = this.cspTmpl || {}))); \ No newline at end of file +})); \ No newline at end of file diff --git a/package.json b/package.json index f78cbd7..c5f5d1c 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ ], "devDependencies": { "coveralls": "^2.11.9", - "eslint": "^2.7.0", + "eslint": "^2.8.0", "esprima": "^2.7.2", "expect.js": "^0.3.1", "hoister": "0.0.2", @@ -43,7 +43,7 @@ "mocha": "^2.4.5", "phantomjs-prebuilt": "^2.1.7", "riot-bump": "^1.0.0", - "rollup": "^0.25.8", + "rollup": "^0.26.0", "rollup-plugin-commonjs": "^2.2.1", "rollup-plugin-node-resolve": "^1.5.0" }, diff --git a/rollup.config.js b/rollup.config.js index bc45c57..1684bb4 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -11,5 +11,5 @@ export default { include: './node_modules/**' }) ], - format: 'iife' + format: 'umd' } \ No newline at end of file diff --git a/test/runner.js b/test/runner.js index 4510260..1f26e2b 100644 --- a/test/runner.js +++ b/test/runner.js @@ -2,7 +2,7 @@ var isNode = typeof window === 'undefined' describe('Tmpl Tests', function () { if (isNode) { - var _ = require('../dist/csp.tmpl').cspTmpl + var _ = require('../dist/tmpl') expect = require('expect.js') tmpl = _.tmpl brackets = _.brackets