@cocreate/utils 1.42.1 → 1.42.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/ObjectId.js +54 -0
- package/dist/cjs/attributes.js +64 -0
- package/dist/cjs/checkValue.js +26 -0
- package/dist/cjs/clickedElement.js +48 -0
- package/dist/cjs/core.js +33 -0
- package/dist/cjs/createUpdate.js +188 -0
- package/dist/cjs/cssPath.js +60 -0
- package/dist/cjs/dataQuery.js +280 -0
- package/dist/cjs/dom.js +29 -0
- package/dist/cjs/domParser.js +44 -0
- package/dist/cjs/dotNotationToObject.js +103 -0
- package/dist/cjs/escapeHtml.js +25 -0
- package/dist/cjs/getRelativePath.js +39 -0
- package/dist/cjs/getValueFromObject.js +41 -0
- package/dist/cjs/index.js +112 -0
- package/dist/cjs/init-browser.js +4 -0
- package/dist/cjs/isValidDate.js +32 -0
- package/dist/cjs/objectToDotNotation.js +53 -0
- package/dist/cjs/objectToSearchParams.js +42 -0
- package/dist/cjs/operators copy.js +562 -0
- package/dist/cjs/operators.js +480 -0
- package/dist/cjs/parseTextToHtml.js +27 -0
- package/dist/cjs/queryElements.js +155 -0
- package/dist/cjs/safeParse.js +169 -0
- package/dist/cjs/uid.js +34 -0
- package/dist/esm/ObjectId.js +35 -0
- package/dist/esm/attributes.js +45 -0
- package/dist/esm/checkValue.js +7 -0
- package/dist/esm/clickedElement.js +29 -0
- package/dist/esm/core.js +14 -0
- package/dist/esm/createUpdate.js +185 -0
- package/dist/esm/cssPath.js +41 -0
- package/dist/esm/dataQuery.js +261 -0
- package/dist/esm/dom.js +10 -0
- package/dist/esm/domParser.js +25 -0
- package/dist/esm/dotNotationToObject.js +84 -0
- package/dist/esm/escapeHtml.js +6 -0
- package/dist/esm/getRelativePath.js +20 -0
- package/dist/esm/getValueFromObject.js +22 -0
- package/dist/esm/index.js +93 -0
- package/dist/esm/init-browser.js +4 -0
- package/dist/esm/isValidDate.js +13 -0
- package/dist/esm/objectToDotNotation.js +34 -0
- package/dist/esm/objectToSearchParams.js +23 -0
- package/dist/esm/operators copy.js +543 -0
- package/dist/esm/operators.js +461 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/parseTextToHtml.js +8 -0
- package/dist/esm/queryElements.js +136 -0
- package/dist/esm/safeParse.js +150 -0
- package/dist/esm/uid.js +15 -0
- package/package.json +11 -109
- package/.github/FUNDING.yml +0 -3
- package/.github/workflows/automated.yml +0 -44
- package/.github/workflows/manual.yml +0 -44
- package/CHANGELOG.md +0 -2082
- package/CoCreate.config.js +0 -23
- package/demo/index.html +0 -23
- package/docs/index.html +0 -331
- package/index.cjs +0 -3
- package/prettier.config.js +0 -16
- package/release.config.js +0 -22
- package/webpack.config.js +0 -65
package/CoCreate.config.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
"organization_id": "",
|
|
3
|
-
"key": "",
|
|
4
|
-
"host": "",
|
|
5
|
-
"sources": [
|
|
6
|
-
{
|
|
7
|
-
"array": "files",
|
|
8
|
-
"object": {
|
|
9
|
-
"_id": "6143fc94829b690010a5f339",
|
|
10
|
-
"name": "index.html",
|
|
11
|
-
"path": "/docs/utils",
|
|
12
|
-
"pathname": "/docs/utils/index.html",
|
|
13
|
-
"src": "{{./docs/index.html}}",
|
|
14
|
-
"host": [
|
|
15
|
-
"*"
|
|
16
|
-
],
|
|
17
|
-
"directory": "utils",
|
|
18
|
-
"content-type": "{{content-type}}",
|
|
19
|
-
"public": "true"
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
]
|
|
23
|
-
};
|
package/demo/index.html
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<title>Utils | CoCreateJS</title>
|
|
5
|
-
|
|
6
|
-
<!-- CoCreate Favicon -->
|
|
7
|
-
<link
|
|
8
|
-
rel="icon"
|
|
9
|
-
type="image/png"
|
|
10
|
-
sizes="32x32"
|
|
11
|
-
href="../assets/favicon.ico" />
|
|
12
|
-
<!-- CoCreate CSS CDN -->
|
|
13
|
-
<link
|
|
14
|
-
rel="stylesheet"
|
|
15
|
-
href="https://cdn.cocreate.app/action/latest/CoCreate-action.min.css"
|
|
16
|
-
type="text/css" />
|
|
17
|
-
<link rel="manifest" href="/manifest.webmanifest" />
|
|
18
|
-
</head>
|
|
19
|
-
<body>
|
|
20
|
-
<!--<script src="../dist/CoCreate-utils.js"></script>-->
|
|
21
|
-
<script src="https://CoCreate.app/dist/CoCreate.js"></script>
|
|
22
|
-
</body>
|
|
23
|
-
</html>
|
package/docs/index.html
DELETED
|
@@ -1,331 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8" />
|
|
5
|
-
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
7
|
-
<title>CoCreate-utils Documentation | CoCreateJS</title>
|
|
8
|
-
<link
|
|
9
|
-
rel="icon"
|
|
10
|
-
type="image/png"
|
|
11
|
-
sizes="32x32"
|
|
12
|
-
href="https://cocreate.app/images/favicon.ico" />
|
|
13
|
-
<meta
|
|
14
|
-
name="description"
|
|
15
|
-
content="A simple HTML5 and pure javascript component. Easy configuration using HTML5 attributes or Javscript api and highly styleable." />
|
|
16
|
-
<meta
|
|
17
|
-
name="keywords"
|
|
18
|
-
content="helper classes, utility classes, css framework, css library, inline style classes" />
|
|
19
|
-
<meta name="robots" content="index,follow" />
|
|
20
|
-
<meta
|
|
21
|
-
property="og:image"
|
|
22
|
-
content="https://cdn.cocreate.app/docs/utils.png" />
|
|
23
|
-
|
|
24
|
-
<link
|
|
25
|
-
rel="stylesheet"
|
|
26
|
-
href="../index.css"
|
|
27
|
-
array="files"
|
|
28
|
-
object="60888216117c640e7596303f"
|
|
29
|
-
key="src"
|
|
30
|
-
type="text/css"
|
|
31
|
-
save="true" />
|
|
32
|
-
<link rel="manifest" href="/manifest.webmanifest" />
|
|
33
|
-
</head>
|
|
34
|
-
|
|
35
|
-
<body>
|
|
36
|
-
<!-- Navbar -->
|
|
37
|
-
<nav
|
|
38
|
-
class="width:100% display:flex align-items:center background:transparent padding-top:10px padding-bottom:10px"
|
|
39
|
-
content_id="content"
|
|
40
|
-
scroll="sticky-nav,"
|
|
41
|
-
scroll-up="5"
|
|
42
|
-
scroll-down="5"
|
|
43
|
-
path="../"
|
|
44
|
-
src="../components/navbar.html"></nav>
|
|
45
|
-
<sidenav
|
|
46
|
-
id="menuL"
|
|
47
|
-
class="position:fixed top:0px left:0px overflow:hidden background:whitesmoke height:100vh width:0px width:300px@xl"
|
|
48
|
-
resizable
|
|
49
|
-
resize-query="[content_id='content']"
|
|
50
|
-
resize-property="margin-left"
|
|
51
|
-
resize-value="width">
|
|
52
|
-
<menu
|
|
53
|
-
array="files"
|
|
54
|
-
object="603717b07de7fb350ae9fec8"
|
|
55
|
-
key="src"></menu>
|
|
56
|
-
<div resize="right"></div>
|
|
57
|
-
</sidenav>
|
|
58
|
-
<main
|
|
59
|
-
class="padding-top:15px padding:15px@lg@xl"
|
|
60
|
-
content_id="content"
|
|
61
|
-
id="cocreate-utils">
|
|
62
|
-
<div
|
|
63
|
-
class="display:flex flex-wrap:wrap justify-content:space-between position:relative margin:10px">
|
|
64
|
-
<div class="display:flex align-items:center">
|
|
65
|
-
<h2>CoCreate-utils</h2>
|
|
66
|
-
</div>
|
|
67
|
-
<div
|
|
68
|
-
class="display:flex align-items:center font-size:20px position:absolute right:0 padding:5px background:white">
|
|
69
|
-
<div
|
|
70
|
-
class="display:flex align-items:center transition:0.3s padding-left:10px"
|
|
71
|
-
share-network="true"
|
|
72
|
-
share-text="Enter decription here"
|
|
73
|
-
share-title="testing im a title"
|
|
74
|
-
share-height="600"
|
|
75
|
-
share-width="700"
|
|
76
|
-
share-media="https://cdn.cocreate.app/docs/utils.png"
|
|
77
|
-
hover="display:block!important"
|
|
78
|
-
hover-query=".social-networks">
|
|
79
|
-
<div class="display:none social-networks">
|
|
80
|
-
<a
|
|
81
|
-
class="margin-right:15px"
|
|
82
|
-
share-network="twitter"
|
|
83
|
-
title="Share on twitter"
|
|
84
|
-
><i src="/assets/svg/twitter.svg"></i
|
|
85
|
-
></a>
|
|
86
|
-
<a
|
|
87
|
-
class="margin-right:15px"
|
|
88
|
-
share-network="facebook"
|
|
89
|
-
title="Share on Facebook"
|
|
90
|
-
><i src="/assets/svg/facebook.svg"></i
|
|
91
|
-
></a>
|
|
92
|
-
<a
|
|
93
|
-
class="margin-right:15px"
|
|
94
|
-
share-network="instagram"
|
|
95
|
-
title="Share on instagram"
|
|
96
|
-
><i src="/assets/svg/instagram.svg"></i
|
|
97
|
-
></a>
|
|
98
|
-
</div>
|
|
99
|
-
<a
|
|
100
|
-
class="margin-right:15px"
|
|
101
|
-
share-network="share"
|
|
102
|
-
title="Share on share"
|
|
103
|
-
><i src="/assets/svg/share-alt.svg"></i
|
|
104
|
-
></a>
|
|
105
|
-
</div>
|
|
106
|
-
<a
|
|
107
|
-
href="https://github.com/CoCreate-app/CoCreate-utils"
|
|
108
|
-
target="_blank"
|
|
109
|
-
class="margin-right:15px"
|
|
110
|
-
><i src="/assets/svg/github.svg"></i
|
|
111
|
-
></a>
|
|
112
|
-
</div>
|
|
113
|
-
</div>
|
|
114
|
-
<h1
|
|
115
|
-
class="max-width:500px margin:20px_10px line-height:1.5 font-size:16px font-weight:100">
|
|
116
|
-
A headless vinilla javascript micro component. Easy
|
|
117
|
-
configuration using HTML5 attributes or Javscript api.
|
|
118
|
-
</h1>
|
|
119
|
-
<div id="utils-section" class="display:flex flex-wrap:wrap">
|
|
120
|
-
<div
|
|
121
|
-
class="flex-grow:1 width:400px width:300px@xs padding:0px_10px margin-top:60px">
|
|
122
|
-
<div
|
|
123
|
-
id="utils-install"
|
|
124
|
-
class="border-bottom:1px_solid_lightgrey"
|
|
125
|
-
scroll
|
|
126
|
-
scroll-intersect="color:dodgerblue"
|
|
127
|
-
scroll-query="#utils-install-section">
|
|
128
|
-
<span
|
|
129
|
-
class="display:flex align-items:center width:fit-content"
|
|
130
|
-
hover="display:block!important"
|
|
131
|
-
hover-query="[href='#utils-install']">
|
|
132
|
-
<h2 class="padding:5px_0px">Install</h2>
|
|
133
|
-
<a
|
|
134
|
-
class="margin-left:10px display:none"
|
|
135
|
-
href="#utils-install"
|
|
136
|
-
><i src="/assets/svg/link.svg"></i
|
|
137
|
-
></a>
|
|
138
|
-
</span>
|
|
139
|
-
</div>
|
|
140
|
-
<pre
|
|
141
|
-
class="margin-top:15px"><code class="language-bash">npm i @cocreate/utils</code></pre>
|
|
142
|
-
<p class="padding:10px_0px line-height:1.5">
|
|
143
|
-
Or you can use cdn link:
|
|
144
|
-
</p>
|
|
145
|
-
<pre><code class="language-html"><script>https://cdn.cocreate.app/utils/latest/CoCreate-utils.min.js</script></code></pre>
|
|
146
|
-
|
|
147
|
-
<div
|
|
148
|
-
id="utils-usage"
|
|
149
|
-
class="margin-top:80px border-bottom:1px_solid_lightgrey"
|
|
150
|
-
scroll
|
|
151
|
-
scroll-intersect="color:dodgerblue"
|
|
152
|
-
scroll-query="#utils-usage-section">
|
|
153
|
-
<span
|
|
154
|
-
class="display:flex align-items:center width:fit-content"
|
|
155
|
-
hover="display:block!important"
|
|
156
|
-
hover-query="[href='#utils-usage']">
|
|
157
|
-
<h2 class="padding:5px_0px">Usage</h2>
|
|
158
|
-
<a
|
|
159
|
-
class="margin-left:10px display:none"
|
|
160
|
-
href="#utils-usage"
|
|
161
|
-
><i src="/assets/svg/link.svg"></i
|
|
162
|
-
></a>
|
|
163
|
-
</span>
|
|
164
|
-
</div>
|
|
165
|
-
<p class="padding:10px_0px line-height:1.5">
|
|
166
|
-
utils usage content
|
|
167
|
-
</p>
|
|
168
|
-
<pre><code class="language-html"><div></div></code></pre>
|
|
169
|
-
|
|
170
|
-
<div
|
|
171
|
-
id="utils-attributes"
|
|
172
|
-
class="margin-top:80px border-bottom:1px_solid_lightgrey"
|
|
173
|
-
scroll
|
|
174
|
-
scroll-intersect="color:dodgerblue"
|
|
175
|
-
scroll-query="#utils-attributes-section">
|
|
176
|
-
<span
|
|
177
|
-
class="display:flex align-items:center width:fit-content"
|
|
178
|
-
hover="display:block!important"
|
|
179
|
-
hover-query="[href='#utils-attributes']">
|
|
180
|
-
<h2 class="padding:5px_0px">Attributes</h2>
|
|
181
|
-
<a
|
|
182
|
-
class="margin-left:10px display:none"
|
|
183
|
-
href="#utils-attributes"
|
|
184
|
-
><i src="/assets/svg/link.svg"></i
|
|
185
|
-
></a>
|
|
186
|
-
</span>
|
|
187
|
-
</div>
|
|
188
|
-
<ul class="list-style-type:none">
|
|
189
|
-
<li
|
|
190
|
-
class="padding:15px_0px border-bottom:1px_solid_lightgrey">
|
|
191
|
-
<h4>
|
|
192
|
-
<span>utils</span>
|
|
193
|
-
<span class="cocreate-badge success"
|
|
194
|
-
>string</span
|
|
195
|
-
>
|
|
196
|
-
<span class="cocreate-badge warning"
|
|
197
|
-
>optional</span
|
|
198
|
-
>
|
|
199
|
-
</h4>
|
|
200
|
-
<p>utils-attribute</p>
|
|
201
|
-
</li>
|
|
202
|
-
<li
|
|
203
|
-
class="padding:15px_0px border-bottom:1px_solid_lightgrey">
|
|
204
|
-
<h4>
|
|
205
|
-
<span>utils</span>
|
|
206
|
-
<span class="cocreate-badge success"
|
|
207
|
-
>string</span
|
|
208
|
-
>
|
|
209
|
-
<span class="cocreate-badge warning"
|
|
210
|
-
>optional</span
|
|
211
|
-
>
|
|
212
|
-
</h4>
|
|
213
|
-
<p>utils-attribute</p>
|
|
214
|
-
</li>
|
|
215
|
-
</ul>
|
|
216
|
-
</div>
|
|
217
|
-
|
|
218
|
-
<div
|
|
219
|
-
class="flex-grow:1 width:300px padding:0px_10px margin-top:60px border-bottom:1px_solid_lightgrey">
|
|
220
|
-
<!-- SandBox -->
|
|
221
|
-
<div
|
|
222
|
-
id="utils-demo"
|
|
223
|
-
class="border-bottom:1px_solid_lightgrey"
|
|
224
|
-
scroll
|
|
225
|
-
scroll-intersect="color:dodgerblue"
|
|
226
|
-
scroll-query="#utils-demo-section">
|
|
227
|
-
<span
|
|
228
|
-
class="display:flex align-items:center width:fit-content"
|
|
229
|
-
hover="display:block!important"
|
|
230
|
-
hover-query="[href='#utils-demo']">
|
|
231
|
-
<h2 class="padding:5px_0px">Demo</h2>
|
|
232
|
-
<a
|
|
233
|
-
class="margin-left:10px display:none"
|
|
234
|
-
href="#utils-demo"
|
|
235
|
-
><i src="/assets/svg/link.svg"></i
|
|
236
|
-
></a>
|
|
237
|
-
</span>
|
|
238
|
-
</div>
|
|
239
|
-
<div
|
|
240
|
-
class="position:sticky top:0 padding:10px_0px height:100vh">
|
|
241
|
-
<!-- SandBox -->
|
|
242
|
-
<div
|
|
243
|
-
class="display:flex flex-direction:column position:relative overflow:hidden card border-radius:2px width:auto height:600px margin-top:20px"
|
|
244
|
-
id="playground">
|
|
245
|
-
<div
|
|
246
|
-
id="demo-code"
|
|
247
|
-
resizable
|
|
248
|
-
class="position:relative height:50%">
|
|
249
|
-
<textarea
|
|
250
|
-
type="code"
|
|
251
|
-
lang="html"
|
|
252
|
-
array="demos"
|
|
253
|
-
object=""
|
|
254
|
-
key="demo"
|
|
255
|
-
save="false"
|
|
256
|
-
id="demo"
|
|
257
|
-
input-query=".demopreview"
|
|
258
|
-
input-attribute="value"
|
|
259
|
-
input-events="input, onload"
|
|
260
|
-
class="height:100% width:100% outline:none border:none resize:none padding:5px"></textarea>
|
|
261
|
-
<div
|
|
262
|
-
resize="bottom"
|
|
263
|
-
class="background:lightgrey"></div>
|
|
264
|
-
</div>
|
|
265
|
-
|
|
266
|
-
<div
|
|
267
|
-
id="demo-preview"
|
|
268
|
-
class="position:relative overflow:auto background-color:white">
|
|
269
|
-
<div class="demopreview padding:20px"></div>
|
|
270
|
-
</div>
|
|
271
|
-
|
|
272
|
-
<div
|
|
273
|
-
class="font-size:20px position:absolute top:10px right:10px opacity:0.6">
|
|
274
|
-
<a
|
|
275
|
-
class="margin-right:10px"
|
|
276
|
-
id="eye"
|
|
277
|
-
show="#eye-slash"
|
|
278
|
-
hide="#eye, #demo-preview"
|
|
279
|
-
toggle="code-height"
|
|
280
|
-
toggle-query="#demo-code"
|
|
281
|
-
><i
|
|
282
|
-
class="height:18px"
|
|
283
|
-
src="/assets/svg/eye.svg"></i
|
|
284
|
-
></a>
|
|
285
|
-
<a
|
|
286
|
-
class="margin-right:10px"
|
|
287
|
-
hidden
|
|
288
|
-
id="eye-slash"
|
|
289
|
-
show="#eye, #demo-preview"
|
|
290
|
-
hide="#eye-slash"
|
|
291
|
-
toggle="code-height"
|
|
292
|
-
toggle-query="#demo-code"
|
|
293
|
-
><i src="/assets/svg/eye-slash.svg"></i
|
|
294
|
-
></a>
|
|
295
|
-
<a
|
|
296
|
-
class="margin-right:10px"
|
|
297
|
-
id="code"
|
|
298
|
-
show="#code-slash"
|
|
299
|
-
hide="#code, #demo-code"
|
|
300
|
-
><i src="/assets/svg/code.svg"></i
|
|
301
|
-
></a>
|
|
302
|
-
<a
|
|
303
|
-
class="margin-right:10px"
|
|
304
|
-
hidden
|
|
305
|
-
id="code-slash"
|
|
306
|
-
show="#code, #demo-code"
|
|
307
|
-
hide="#code-slash"
|
|
308
|
-
><i
|
|
309
|
-
class="height:18px"
|
|
310
|
-
src="/assets/svg/code.svg"></i
|
|
311
|
-
></a>
|
|
312
|
-
<a
|
|
313
|
-
class="margin-right:5px"
|
|
314
|
-
fullscreen
|
|
315
|
-
fullscreen-query="#playground"></a>
|
|
316
|
-
</div>
|
|
317
|
-
</div>
|
|
318
|
-
<!-- End SandBox -->
|
|
319
|
-
</div>
|
|
320
|
-
</div>
|
|
321
|
-
</div>
|
|
322
|
-
<button
|
|
323
|
-
href="https://github.com/CoCreate-app/CoCreate-utils/tree/master/docs/index.html?message=docs%3A%20describe%20your%20change..."
|
|
324
|
-
target="_blank"
|
|
325
|
-
class="display:flex justify-content:center align-items:center position:fixed bottom:15px right:15px height:50px width:50px border-radius:50% box-shadow:0px_2px_10px_0px_rgba(0,_0,_0,_0.4)">
|
|
326
|
-
<i src="../assets/svg/pencil-alt.svg"></i>
|
|
327
|
-
</button>
|
|
328
|
-
</main>
|
|
329
|
-
<script src="https://CoCreate.app/dist/CoCreate.js"></script>
|
|
330
|
-
</body>
|
|
331
|
-
</html>
|
package/index.cjs
DELETED
package/prettier.config.js
DELETED
package/release.config.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
dryRun: false,
|
|
3
|
-
branches: ["master"],
|
|
4
|
-
plugins: [
|
|
5
|
-
"@semantic-release/commit-analyzer",
|
|
6
|
-
"@semantic-release/release-notes-generator",
|
|
7
|
-
[
|
|
8
|
-
"@semantic-release/changelog",
|
|
9
|
-
{
|
|
10
|
-
changelogFile: "CHANGELOG.md",
|
|
11
|
-
},
|
|
12
|
-
],
|
|
13
|
-
"@semantic-release/npm",
|
|
14
|
-
"@semantic-release/github",
|
|
15
|
-
[
|
|
16
|
-
"@semantic-release/git",
|
|
17
|
-
{
|
|
18
|
-
assets: ["CHANGELOG.md", "package.json"],
|
|
19
|
-
},
|
|
20
|
-
],
|
|
21
|
-
],
|
|
22
|
-
};
|
package/webpack.config.js
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
const path = require("path");
|
|
2
|
-
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
|
|
3
|
-
const { EsbuildPlugin } = require("esbuild-loader");
|
|
4
|
-
const { FileUploader } = require("@cocreate/webpack");
|
|
5
|
-
|
|
6
|
-
module.exports = async (env, argv) => {
|
|
7
|
-
const isProduction = argv && argv.mode === "production";
|
|
8
|
-
const config = {
|
|
9
|
-
entry: {
|
|
10
|
-
"CoCreate-utils": "./src/index.js"
|
|
11
|
-
},
|
|
12
|
-
output: {
|
|
13
|
-
path: path.resolve(__dirname, "dist"),
|
|
14
|
-
filename: isProduction ? "[name].min.js" : "[name].js",
|
|
15
|
-
libraryExport: "default",
|
|
16
|
-
library: ["CoCreate", "utils"],
|
|
17
|
-
clean: true
|
|
18
|
-
},
|
|
19
|
-
plugins: [
|
|
20
|
-
new MiniCssExtractPlugin({
|
|
21
|
-
filename: isProduction ? "[name].min.css" : "[name].css"
|
|
22
|
-
}),
|
|
23
|
-
new FileUploader(env, argv)
|
|
24
|
-
],
|
|
25
|
-
mode: isProduction ? "production" : "development",
|
|
26
|
-
devtool: isProduction ? "source-map" : "eval-source-map",
|
|
27
|
-
module: {
|
|
28
|
-
rules: [
|
|
29
|
-
{
|
|
30
|
-
test: /.js$/,
|
|
31
|
-
exclude: /node_modules/,
|
|
32
|
-
use: {
|
|
33
|
-
loader: "esbuild-loader",
|
|
34
|
-
options: {
|
|
35
|
-
loader: "js",
|
|
36
|
-
target: "es2017"
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
test: /.css$/i,
|
|
42
|
-
use: [MiniCssExtractPlugin.loader, "css-loader"]
|
|
43
|
-
}
|
|
44
|
-
]
|
|
45
|
-
},
|
|
46
|
-
optimization: {
|
|
47
|
-
minimize: isProduction,
|
|
48
|
-
minimizer: [
|
|
49
|
-
new EsbuildPlugin({
|
|
50
|
-
target: "es2017",
|
|
51
|
-
css: true
|
|
52
|
-
})
|
|
53
|
-
],
|
|
54
|
-
splitChunks: {
|
|
55
|
-
cacheGroups: {
|
|
56
|
-
defaultVendors: false
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
performance: {
|
|
61
|
-
hints: isProduction ? "warning" : false
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
return config;
|
|
65
|
-
};
|