@cocreate/cursors 1.24.1 → 1.24.3

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/CHANGELOG.md CHANGED
@@ -1,3 +1,20 @@
1
+ ## [1.24.3](https://github.com/CoCreate-app/CoCreate-cursors/compare/v1.24.2...v1.24.3) (2025-05-01)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * update [@cocreate](https://github.com/cocreate) dependencies ([488b4aa](https://github.com/CoCreate-app/CoCreate-cursors/commit/488b4aadf06c77c251f8454c560e4f8816e71078))
7
+
8
+ ## [1.24.2](https://github.com/CoCreate-app/CoCreate-cursors/compare/v1.24.1...v1.24.2) (2025-04-30)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * added css-loader ([eab505a](https://github.com/CoCreate-app/CoCreate-cursors/commit/eab505acd6c3ef74fa38e7bf27ad0a6b5ab73ad1))
14
+ * update query attributes ([7afd3d7](https://github.com/CoCreate-app/CoCreate-cursors/commit/7afd3d79c2a038773f59ed82bf0e82a76303487b))
15
+ * updated cocreate modules versions ([7db97ed](https://github.com/CoCreate-app/CoCreate-cursors/commit/7db97ed3ba4bae6efe88e6f6e6eac52cef464ec7))
16
+ * webpack.config and devdependencies ([9a6e1ca](https://github.com/CoCreate-app/CoCreate-cursors/commit/9a6e1ca6726667eba70969548f7232ce1a4b66c7))
17
+
1
18
  ## [1.24.1](https://github.com/CoCreate-app/CoCreate-cursors/compare/v1.24.0...v1.24.1) (2025-04-11)
2
19
 
3
20
 
package/docs/index.html CHANGED
@@ -1,131 +1,131 @@
1
1
  <!DOCTYPE html>
2
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-cursor 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/boilerplate.png" />
23
- <link
24
- rel="stylesheet"
25
- href="../index.css"
26
- array="files"
27
- object="60888216117c640e7596303f"
28
- key="src"
29
- type="text/css"
30
- save="true" />
31
- <link rel="manifest" href="/manifest.webmanifest" />
32
- </head>
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-cursor 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/boilerplate.png" />
23
+ <link
24
+ rel="stylesheet"
25
+ href="../index.css"
26
+ array="files"
27
+ object="60888216117c640e7596303f"
28
+ key="src"
29
+ type="text/css"
30
+ save="true" />
31
+ <link rel="manifest" href="/manifest.webmanifest" />
32
+ </head>
33
33
 
34
- <body>
35
- <!-- Navbar -->
36
- <nav
37
- class="width:100% display:flex align-items:center background:transparent padding-top:10px padding-bottom:10px"
38
- content_id="content"
39
- scroll="sticky-nav,"
40
- scroll-up="5"
41
- scroll-down="5"
42
- path="../"
43
- src="../components/navbar.html"></nav>
44
- <sidenav
45
- id="menuL"
46
- class="position:fixed top:0px left:0px overflow:hidden background:whitesmoke height:100vh width:0px width:300px@xl"
47
- resizable
48
- resize-selector="[content_id='content']"
49
- resize-property="margin-left"
50
- resize-value="width">
51
- <menu
52
- array="files"
53
- object="603717b07de7fb350ae9fec8"
54
- key="src"></menu>
55
- <div resize="right"></div>
56
- </sidenav>
57
- <main
58
- class="padding-top:15px padding:15px@lg@xl"
59
- content_id="content"
60
- id="cocreate-cursor">
61
- <div
62
- class="display:flex flex-wrap:wrap justify-content:space-between">
63
- <div class="display:flex align-items:center">
64
- <h2>CoCreate-cursor</h2>
65
- </div>
66
- <div
67
- class="display:flex align-items:center font-size:20px"
68
- share-height="600"
69
- share-width="500"
70
- share-media="https://via.placeholder.com/300/09f/fff.png">
71
- <a
72
- href="https://github.com/CoCreate-app/CoCreate-cursor"
73
- target="_blank"
74
- class="margin-right:15px"
75
- ><i src="/assets/svg/github.svg"></i
76
- ></a>
77
- <a
78
- class="margin-right:15px share"
79
- share-network="twitter"
80
- title="Share on twitter"
81
- ><i src="/assets/svg/twitter.svg"></i
82
- ></a>
83
- <a
84
- class="margin-right:15px share"
85
- share-network="facebook"
86
- title="Share on Facebook"
87
- ><i src="/assets/svg/facebook.svg"></i
88
- ></a>
89
- <a
90
- class="margin-right:15px share"
91
- share-network="instagram"
92
- title="Share on instagram"
93
- ><i src="/assets/svg/instagram.svg"></i
94
- ></a>
95
- <a
96
- class="margin-right:15px share"
97
- share-network="share"
98
- title="Share on share"
99
- ><i src="/assets/svg/share-alt.svg"></i
100
- ></a>
101
- </div>
102
- </div>
103
- <p class="max-width:500px margin:20px_0px">
104
- A simple component of HTML5, CSS and pure JavaScript. Easy
105
- configuration using data attributes and highly stylizable, whose
106
- objective is to provide a shared cursor in an html element
107
- (input, textarea or div [content-editable])
108
- </p>
109
- <div id="cursor-section" class="display:flex flex-wrap:wrap">
110
- <div
111
- class="flex-grow:1 width:300px padding:0px_10px margin:20px_0px">
112
- <h2
113
- class="border-bottom:1px_solid_lightgrey padding:5px_0px">
114
- Install
115
- </h2>
116
- <pre><code class="language-javascript">npm install cocreate-cursors</code></pre>
117
- <p class="padding:10px_0px">Or you can use cdn link:</p>
118
- <pre><code class="language-javascript">https://cdn.cocreate.app/CoCreate-cursors.min.js</code></pre>
34
+ <body>
35
+ <!-- Navbar -->
36
+ <nav
37
+ class="width:100% display:flex align-items:center background:transparent padding-top:10px padding-bottom:10px"
38
+ content_id="content"
39
+ scroll="sticky-nav,"
40
+ scroll-up="5"
41
+ scroll-down="5"
42
+ path="../"
43
+ src="../components/navbar.html"></nav>
44
+ <sidenav
45
+ id="menuL"
46
+ class="position:fixed top:0px left:0px overflow:hidden background:whitesmoke height:100vh width:0px width:300px@xl"
47
+ resizable
48
+ resize-query="[content_id='content']"
49
+ resize-property="margin-left"
50
+ resize-value="width">
51
+ <menu
52
+ array="files"
53
+ object="603717b07de7fb350ae9fec8"
54
+ key="src"></menu>
55
+ <div resize="right"></div>
56
+ </sidenav>
57
+ <main
58
+ class="padding-top:15px padding:15px@lg@xl"
59
+ content_id="content"
60
+ id="cocreate-cursor">
61
+ <div
62
+ class="display:flex flex-wrap:wrap justify-content:space-between">
63
+ <div class="display:flex align-items:center">
64
+ <h2>CoCreate-cursor</h2>
65
+ </div>
66
+ <div
67
+ class="display:flex align-items:center font-size:20px"
68
+ share-height="600"
69
+ share-width="500"
70
+ share-media="https://via.placeholder.com/300/09f/fff.png">
71
+ <a
72
+ href="https://github.com/CoCreate-app/CoCreate-cursor"
73
+ target="_blank"
74
+ class="margin-right:15px"
75
+ ><i src="/assets/svg/github.svg"></i
76
+ ></a>
77
+ <a
78
+ class="margin-right:15px share"
79
+ share-network="twitter"
80
+ title="Share on twitter"
81
+ ><i src="/assets/svg/twitter.svg"></i
82
+ ></a>
83
+ <a
84
+ class="margin-right:15px share"
85
+ share-network="facebook"
86
+ title="Share on Facebook"
87
+ ><i src="/assets/svg/facebook.svg"></i
88
+ ></a>
89
+ <a
90
+ class="margin-right:15px share"
91
+ share-network="instagram"
92
+ title="Share on instagram"
93
+ ><i src="/assets/svg/instagram.svg"></i
94
+ ></a>
95
+ <a
96
+ class="margin-right:15px share"
97
+ share-network="share"
98
+ title="Share on share"
99
+ ><i src="/assets/svg/share-alt.svg"></i
100
+ ></a>
101
+ </div>
102
+ </div>
103
+ <p class="max-width:500px margin:20px_0px">
104
+ A simple component of HTML5, CSS and pure JavaScript. Easy
105
+ configuration using data attributes and highly stylizable, whose
106
+ objective is to provide a shared cursor in an html element
107
+ (input, textarea or div [content-editable])
108
+ </p>
109
+ <div id="cursor-section" class="display:flex flex-wrap:wrap">
110
+ <div
111
+ class="flex-grow:1 width:300px padding:0px_10px margin:20px_0px">
112
+ <h2
113
+ class="border-bottom:1px_solid_lightgrey padding:5px_0px">
114
+ Install
115
+ </h2>
116
+ <pre><code class="language-javascript">npm install cocreate-cursors</code></pre>
117
+ <p class="padding:10px_0px">Or you can use cdn link:</p>
118
+ <pre><code class="language-javascript">https://cdn.cocreate.app/CoCreate-cursors.min.js</code></pre>
119
119
 
120
- <h2
121
- class="border-bottom:1px_solid_lightgrey margin-top:80px padding:5px_0px">
122
- Usage
123
- </h2>
124
- <div class="">
125
- <p class="padding:10px_0px">This is cursor reference</p>
120
+ <h2
121
+ class="border-bottom:1px_solid_lightgrey margin-top:80px padding:5px_0px">
122
+ Usage
123
+ </h2>
124
+ <div class="">
125
+ <p class="padding:10px_0px">This is cursor reference</p>
126
126
 
127
- <div class="flex-grow:1 min-width:300px width:100%">
128
- <pre>
127
+ <div class="flex-grow:1 min-width:300px width:100%">
128
+ <pre>
129
129
  <code>
130
130
  &lt;form array=&quot;module_activities&quot; class=&quot;margin:20px&quot;&gt;
131
131
  &lt;textarea
@@ -139,122 +139,122 @@
139
139
  &lt;/form&gt;
140
140
  </code>
141
141
  </pre>
142
- </div>
143
- <p class="padding:10px_0px">This is cursor reference</p>
144
- </div>
145
- <h2
146
- class="border-bottom:1px_solid_lightgrey padding:5px_0px">
147
- Attributes
148
- </h2>
149
- <ul class="list-style-type:none">
150
- <li
151
- class="padding:15px_0px border-bottom:1px_solid_lightgrey">
152
- <h4>
153
- <span>-</span>
154
- <span class="cocreate-badge success"
155
- >string</span
156
- >
157
- <span class="cocreate-badge warning"
158
- >optional</span
159
- >
160
- </h4>
161
- <p>
162
- It has no data attributes, the cursor starts
163
- automatically for elements with realtime = true
164
- </p>
165
- </li>
166
- </ul>
167
- </div>
142
+ </div>
143
+ <p class="padding:10px_0px">This is cursor reference</p>
144
+ </div>
145
+ <h2
146
+ class="border-bottom:1px_solid_lightgrey padding:5px_0px">
147
+ Attributes
148
+ </h2>
149
+ <ul class="list-style-type:none">
150
+ <li
151
+ class="padding:15px_0px border-bottom:1px_solid_lightgrey">
152
+ <h4>
153
+ <span>-</span>
154
+ <span class="cocreate-badge success"
155
+ >string</span
156
+ >
157
+ <span class="cocreate-badge warning"
158
+ >optional</span
159
+ >
160
+ </h4>
161
+ <p>
162
+ It has no data attributes, the cursor starts
163
+ automatically for elements with realtime = true
164
+ </p>
165
+ </li>
166
+ </ul>
167
+ </div>
168
168
 
169
- <div
170
- class="flex-grow:1 width:300px padding:0px_10px margin:20px_0px border-bottom:1px_solid_lightgrey">
171
- <!-- SandBox -->
172
- <h2
173
- class="border-bottom:1px_solid_lightgrey padding:5px_0px">
174
- Demo
175
- </h2>
176
- <div
177
- class="position:sticky top:0 padding:15px_0px height:100vh">
178
- <!-- SandBox -->
179
- <div
180
- class="display:flex flex-direction:column position:relative overflow:hidden card border-radius:2px width:auto height:600px margin-top:20px"
181
- id="playground">
182
- <div
183
- id="demo-code"
184
- resizable
185
- class="position:relative height:50%">
186
- <textarea
187
- type="code"
188
- lang="html"
189
- array="demos"
190
- object=""
191
- key="demo"
192
- save="false"
193
- id="demo"
194
- class="height:100% width:100% outline:none border:none resize:none padding:5px"></textarea>
195
- <div
196
- resize="bottom"
197
- class="background:lightgrey"></div>
198
- </div>
169
+ <div
170
+ class="flex-grow:1 width:300px padding:0px_10px margin:20px_0px border-bottom:1px_solid_lightgrey">
171
+ <!-- SandBox -->
172
+ <h2
173
+ class="border-bottom:1px_solid_lightgrey padding:5px_0px">
174
+ Demo
175
+ </h2>
176
+ <div
177
+ class="position:sticky top:0 padding:15px_0px height:100vh">
178
+ <!-- SandBox -->
179
+ <div
180
+ class="display:flex flex-direction:column position:relative overflow:hidden card border-radius:2px width:auto height:600px margin-top:20px"
181
+ id="playground">
182
+ <div
183
+ id="demo-code"
184
+ resizable
185
+ class="position:relative height:50%">
186
+ <textarea
187
+ type="code"
188
+ lang="html"
189
+ array="demos"
190
+ object=""
191
+ key="demo"
192
+ save="false"
193
+ id="demo"
194
+ class="height:100% width:100% outline:none border:none resize:none padding:5px"></textarea>
195
+ <div
196
+ resize="bottom"
197
+ class="background:lightgrey"></div>
198
+ </div>
199
199
 
200
- <div
201
- id="demo-preview"
202
- class="position:relative overflow:auto background-color:white">
203
- <div class="demopreview padding:20px"></div>
204
- </div>
200
+ <div
201
+ id="demo-preview"
202
+ class="position:relative overflow:auto background-color:white">
203
+ <div class="demopreview padding:20px"></div>
204
+ </div>
205
205
 
206
- <div
207
- class="font-size:20px position:absolute top:10px right:10px opacity:0.6">
208
- <a
209
- class="margin-right:10px"
210
- id="eye"
211
- show="#eye-slash"
212
- hide="#eye, #demo-preview"
213
- toggle="code-height"
214
- toggle-selector="#demo-code"
215
- ><i
216
- class="height:18px"
217
- src="/assets/svg/eye.svg"></i
218
- ></a>
219
- <a
220
- class="margin-right:10px"
221
- hidden
222
- id="eye-slash"
223
- show="#eye, #demo-preview"
224
- hide="#eye-slash"
225
- toggle="code-height"
226
- toggle-selector="#demo-code"
227
- ><i src="/assets/svg/eye-slash.svg"></i
228
- ></a>
229
- <a
230
- class="margin-right:10px"
231
- id="code"
232
- show="#code-slash"
233
- hide="#code, #demo-code"
234
- ><i src="/assets/svg/code.svg"></i
235
- ></a>
236
- <a
237
- class="margin-right:10px"
238
- hidden
239
- id="code-slash"
240
- show="#code, #demo-code"
241
- hide="#code-slash"
242
- ><i
243
- class="height:18px"
244
- src="/assets/svg/code.svg"></i
245
- ></a>
246
- <a
247
- class="margin-right:5px"
248
- fullscreen
249
- fullscreen-selector="#playground"></a>
250
- </div>
251
- </div>
252
- <!-- End SandBox -->
253
- </div>
254
- </div>
255
- </div>
256
- </main>
206
+ <div
207
+ class="font-size:20px position:absolute top:10px right:10px opacity:0.6">
208
+ <a
209
+ class="margin-right:10px"
210
+ id="eye"
211
+ show="#eye-slash"
212
+ hide="#eye, #demo-preview"
213
+ toggle="code-height"
214
+ toggle-query="#demo-code"
215
+ ><i
216
+ class="height:18px"
217
+ src="/assets/svg/eye.svg"></i
218
+ ></a>
219
+ <a
220
+ class="margin-right:10px"
221
+ hidden
222
+ id="eye-slash"
223
+ show="#eye, #demo-preview"
224
+ hide="#eye-slash"
225
+ toggle="code-height"
226
+ toggle-query="#demo-code"
227
+ ><i src="/assets/svg/eye-slash.svg"></i
228
+ ></a>
229
+ <a
230
+ class="margin-right:10px"
231
+ id="code"
232
+ show="#code-slash"
233
+ hide="#code, #demo-code"
234
+ ><i src="/assets/svg/code.svg"></i
235
+ ></a>
236
+ <a
237
+ class="margin-right:10px"
238
+ hidden
239
+ id="code-slash"
240
+ show="#code, #demo-code"
241
+ hide="#code-slash"
242
+ ><i
243
+ class="height:18px"
244
+ src="/assets/svg/code.svg"></i
245
+ ></a>
246
+ <a
247
+ class="margin-right:5px"
248
+ fullscreen
249
+ fullscreen-query="#playground"></a>
250
+ </div>
251
+ </div>
252
+ <!-- End SandBox -->
253
+ </div>
254
+ </div>
255
+ </div>
256
+ </main>
257
257
 
258
- <script src="https://CoCreate.app/dist/CoCreate.js"></script>
259
- </body>
258
+ <script src="https://CoCreate.app/dist/CoCreate.js"></script>
259
+ </body>
260
260
  </html>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/cursors",
3
- "version": "1.24.1",
3
+ "version": "1.24.3",
4
4
  "description": "Collaborative user cursor position for inputs, textarea's and contenteditable elements.",
5
5
  "keywords": [
6
6
  "cursors",
@@ -46,25 +46,21 @@
46
46
  },
47
47
  "main": "./src/index.js",
48
48
  "devDependencies": {
49
- "@babel/core": "^7.9.6",
50
- "@babel/preset-env": "^7.9.6",
51
- "babel-loader": "^8.1.0",
52
- "clean-webpack-plugin": "^3.0.0",
53
- "file-loader": "^6.2.0",
49
+ "css-loader": "^5.1.3",
50
+ "esbuild": "^0.25.2",
51
+ "esbuild-loader": "^4.3.0",
54
52
  "mini-css-extract-plugin": "^1.5.0",
55
- "style-loader": "^3.3.1",
56
- "terser-webpack-plugin": "^5.1.1",
57
53
  "webpack": "^5.24.4",
58
54
  "webpack-cli": "^4.5.0",
59
55
  "webpack-log": "^3.0.1"
60
56
  },
61
57
  "dependencies": {
62
- "@cocreate/local-storage": "^1.15.0",
63
- "@cocreate/observer": "^1.16.1",
64
- "@cocreate/random-color": "^1.10.1",
65
- "@cocreate/selection": "^1.12.2",
66
- "@cocreate/socket-client": "^1.39.1",
67
- "@cocreate/utils": "^1.33.7",
68
- "@cocreate/uuid": "^1.11.2"
58
+ "@cocreate/local-storage": "^1.16.2",
59
+ "@cocreate/observer": "^1.18.1",
60
+ "@cocreate/random-color": "^1.12.2",
61
+ "@cocreate/selection": "^1.14.1",
62
+ "@cocreate/socket-client": "^1.40.2",
63
+ "@cocreate/utils": "^1.39.0",
64
+ "@cocreate/uuid": "^1.12.1"
69
65
  }
70
66
  }
package/webpack.config.js CHANGED
@@ -1,90 +1,65 @@
1
- const path = require("path")
2
- const TerserPlugin = require("terser-webpack-plugin")
3
- const MiniCssExtractPlugin = require("mini-css-extract-plugin")
4
- const { CleanWebpackPlugin } = require("clean-webpack-plugin")
5
-
6
- module.exports = (env, argv) => {
7
- let isProduction = false
8
- if (argv.mode === 'production')
9
- isProduction = true
10
-
11
- const config = {
12
- entry: {
13
- "CoCreate-cursors": "./src/index.js",
14
- },
15
- output: {
16
- path: path.resolve(__dirname, "dist"),
17
- filename: isProduction ? "[name].min.js" : "[name].js",
18
- libraryTarget: "umd",
19
- libraryExport: "default",
20
- library: ["CoCreate", "cursors"],
21
- globalObject: "this",
22
- },
23
-
24
- plugins: [
25
- new CleanWebpackPlugin(),
26
- new MiniCssExtractPlugin({
27
- filename: "[name].css",
28
- }),
29
- ],
30
- // Default mode for Webpack is production.
31
- // Depending on mode Webpack will apply different things
32
- // on final bundle. For now we don't need production's JavaScript
33
- // minifying and other thing so let's set mode to development
34
- mode: isProduction ? "production" : "development",
35
- module: {
36
- rules: [
37
- {
38
- test: /.js$/,
39
- exclude: /(node_modules)/,
40
- use: {
41
- loader: "babel-loader",
42
- options: {
43
- plugins: ["@babel/plugin-transform-modules-commonjs"],
44
- },
45
- },
46
- },
47
- {
48
- test: /.css$/i,
49
- use: [
50
- { loader: "style-loader", options: { injectType: "linkTag" } },
51
- "file-loader",
52
- ],
53
- },
54
- ],
55
- },
56
-
57
- // add source map
58
- ...(isProduction ? {} : { devtool: "eval-source-map" }),
59
-
60
- optimization: {
61
- minimize: true,
62
- minimizer: [
63
- new TerserPlugin({
64
- extractComments: true,
65
- // cache: true,
66
- parallel: true,
67
- // sourceMap: true, // Must be set to true if using source-maps in production
68
- terserOptions: {
69
- // https://github.com/webpack-contrib/terser-webpack-plugin#terseroptions
70
- // extractComments: 'all',
71
- compress: {
72
- drop_console: true,
73
- },
74
- },
75
- }),
76
- ],
77
- splitChunks: {
78
- chunks: "all",
79
- minSize: 200,
80
- // maxSize: 99999,
81
- //minChunks: 1,
82
-
83
- cacheGroups: {
84
- defaultVendors: false,
85
- },
86
- },
87
- },
88
- }
89
- return config
90
- }
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-cursors": "./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", "cursors"],
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
+ };