瀏覽代碼

Add wildcard for submodules; fix existing esm test and add new.

pull/773/head
Trevor Manz 5 年之前
父節點
當前提交
da78692a1f
共有 2 個檔案被更改,包括 17 行新增2 行删除
  1. +5
    -2
      package.json
  2. +12
    -0
      test/module-systems/esm-test-exports.mjs

+ 5
- 2
package.json 查看文件

@@ -25,8 +25,11 @@
"wrappers/"
],
"exports": {
"import": "./mustache.mjs",
"require": "./mustache.js"
".": {
"import": "./mustache.mjs",
"require": "./mustache.js"
},
"./*": "./*"
},
"volo": {
"url": "https://raw.github.com/janl/mustache.js/{version}/mustache.js"


+ 12
- 0
test/module-systems/esm-test-exports.mjs 查看文件

@@ -0,0 +1,12 @@
import assert from 'assert';
import mustache from 'mustache';

const view = {
title: 'Joe',
calc: () => 2 + 4
};

assert.strictEqual(
mustache.render('{{title}} spends {{calc}}', view),
'Joe spends 6'
);

Loading…
取消
儲存