Skip to content

Commit 3e59222

Browse files
Added an ESM build
1 parent 3a979db commit 3e59222

8 files changed

Lines changed: 1610 additions & 222 deletions

File tree

dist/cash.esm.js

Lines changed: 1253 additions & 0 deletions
Large diffs are not rendered by default.

dist/cash.js

Lines changed: 296 additions & 194 deletions
Large diffs are not rendered by default.

dist/cash.min.js

Lines changed: 27 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pacco.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,28 @@
2121
}
2222
},
2323
"environments": {
24+
"esm": {
25+
"components": {
26+
"core/export_window": false
27+
},
28+
"paths": {
29+
"output": {
30+
"javascript": {
31+
"unminified": "[dist]/[bundle].esm.js",
32+
"minified": false
33+
}
34+
}
35+
},
36+
"plugins": {
37+
"wrapper": {
38+
"options": {
39+
"templates": {
40+
"default": "/* MIT https://github.com/kenwheeler/cash */\n[content]\nexport default cash;\n"
41+
}
42+
}
43+
}
44+
}
45+
},
2446
"production": {
2547
"plugins": {
2648
"uglify": {

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,13 @@
44
"version": "2.1.6",
55
"license": "MIT",
66
"main": "./dist/cash.js",
7+
"module": "./dist/cash.esm.js",
8+
"jsnext:main": "./dist/cash.esm.js",
79
"scripts": {
810
"clean": "pacco clean",
11+
"build:esm": "pacco build-javascript -e esm",
912
"build:prod": "pacco build-javascript",
13+
"build:deploy": "npm run build:esm && npm run build:prod",
1014
"build:dev": "pacco build-javascript -e development",
1115
"watch:prod": "pacco watch-javascript",
1216
"watch:dev": "pacco watch-javascript -e development",

src/core/cash.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ function Cash ( selector, context ) {
3636

3737
}
3838

39-
win.cash = win.$ = function cash ( selector, context ) {
39+
function cash ( selector, context ) {
4040
return new Cash ( selector, context );
41-
};
41+
}
4242

4343
/* PROTOTYPE */
4444

src/core/export_window.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
// @require ./cash.js
3+
// @require ./variables.js
4+
5+
win.cash = win.$ = cash;

src/core/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

22
// @optional ./camel_case.js
33
// @optional ./each.js
4+
// @optional ./export_window.js
45
// @optional ./extend.js
56
// @optional ./find.js
67
// @optional ./get_compare_function.js

0 commit comments

Comments
 (0)