@cocreate/crdt 1.27.6 → 1.28.1

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,25 @@
1
+ ## [1.28.1](https://github.com/CoCreate-app/CoCreate-crdt/compare/v1.28.0...v1.28.1) (2025-04-30)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * added css-loader ([c8f5f94](https://github.com/CoCreate-app/CoCreate-crdt/commit/c8f5f94110b92df35c47c3c3c42729f01b058398))
7
+ * update query attributes ([5c5333d](https://github.com/CoCreate-app/CoCreate-crdt/commit/5c5333d7b22f45658af0fae7d2bc8f10ac46bc33))
8
+ * updated cocreate modules versions ([c488e35](https://github.com/CoCreate-app/CoCreate-crdt/commit/c488e35995bbb43f2633d7ea91a5a8f5b9fd38e1))
9
+ * webpack.config and devdependencies ([7502d88](https://github.com/CoCreate-app/CoCreate-crdt/commit/7502d88d12b890ebfd1cad61cc6172f405d5db33))
10
+
11
+ # [1.28.0](https://github.com/CoCreate-app/CoCreate-crdt/compare/v1.27.6...v1.28.0) (2024-11-04)
12
+
13
+
14
+ ### Bug Fixes
15
+
16
+ * pretier.config.js and file formating ([f4a4b93](https://github.com/CoCreate-app/CoCreate-crdt/commit/f4a4b93cbf220ec8744f327e516f6986bd247d03))
17
+
18
+
19
+ ### Features
20
+
21
+ * add prettier.config.js and format files ([b510864](https://github.com/CoCreate-app/CoCreate-crdt/commit/b510864e5ed475765de5c82d774f65aae75936af))
22
+
1
23
  ## [1.27.6](https://github.com/CoCreate-app/CoCreate-crdt/compare/v1.27.5...v1.27.6) (2024-08-24)
2
24
 
3
25
 
package/docs/index.html CHANGED
@@ -1,252 +1,252 @@
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-crdt 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" />
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-crdt 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
20
 
21
- <link rel="manifest" href="/manifest.webmanifest" />
22
- </head>
21
+ <link rel="manifest" href="/manifest.webmanifest" />
22
+ </head>
23
23
 
24
- <body>
25
- <!-- Navbar -->
26
- <nav
27
- class="width:100% display:flex align-items:center background:transparent padding-top:10px padding-bottom:10px"
28
- content_id="content"
29
- scroll="sticky-nav,"
30
- scroll-up="5"
31
- scroll-down="5"
32
- path="../"
33
- src="../components/navbar.html"></nav>
34
- <sidenav
35
- id="menuL"
36
- class="position:fixed top:0px left:0px overflow:hidden background:whitesmoke height:100vh width:0px width:300px@xl"
37
- resizable
38
- resize-selector="[content_id='content']"
39
- resize-property="margin-left"
40
- resize-value="width">
41
- <menu
42
- array="files"
43
- object="603717b07de7fb350ae9fec8"
44
- key="src"></menu>
45
- <div resize="right"></div>
46
- </sidenav>
47
- <main
48
- class="padding-top:15px padding:15px@lg@xl"
49
- content_id="content"
50
- id="cocreate-crdt">
51
- <div
52
- class="display:flex flex-wrap:wrap justify-content:space-between margin:10px">
53
- <div class="display:flex align-items:center">
54
- <h2>CoCreate-crdt</h2>
55
- </div>
56
- <div
57
- class="display:flex align-items:center font-size:20px"
58
- share-height="600"
59
- share-width="500"
60
- share-media="https://via.placeholder.com/300/09f/fff.png">
61
- <a
62
- href="https://github.com/CoCreate-app/CoCreate-crdt"
63
- target="_blank"
64
- class="margin-right:15px"
65
- ><i src="/assets/svg/github.svg"></i
66
- ></a>
67
- <a
68
- class="margin-right:15px share"
69
- share-network="twitter"
70
- title="Share on twitter"
71
- ><i src="/assets/svg/twitter.svg"></i
72
- ></a>
73
- <a
74
- class="margin-right:15px share"
75
- share-network="facebook"
76
- title="Share on Facebook"
77
- ><i src="/assets/svg/facebook.svg"></i
78
- ></a>
79
- <a
80
- class="margin-right:15px share"
81
- share-network="instagram"
82
- title="Share on instagram"
83
- ><i src="/assets/svg/instagram.svg"></i
84
- ></a>
85
- <a
86
- class="margin-right:15px share"
87
- share-network="share"
88
- title="Share on share"
89
- ><i src="/assets/svg/share-alt.svg"></i
90
- ></a>
91
- </div>
92
- </div>
93
- <p class="max-width:500px margin:20px_10px">
94
- A headless vinilla javascript micro component. Easy
95
- configuration using HTML5 attributes or Javscript api.
96
- </p>
97
- <div id="crdt-section" class="display:flex flex-wrap:wrap">
98
- <div class="flex-grow:1 width:300px padding:20px_10px">
99
- <h2
100
- class="border-bottom:1px_solid_lightgrey padding:5px_0px">
101
- Install
102
- </h2>
103
- <pre
104
- class="margin-top:15px"><code class="language-javascript">npm install cocreate-crdt</code></pre>
105
- <p class="padding:10px_0px">Or you can use cdn link:</p>
106
- <pre><code class="language-javascript">https://cdn.cocreate.app/js/CoCreate-crdt.min.js</code></pre>
24
+ <body>
25
+ <!-- Navbar -->
26
+ <nav
27
+ class="width:100% display:flex align-items:center background:transparent padding-top:10px padding-bottom:10px"
28
+ content_id="content"
29
+ scroll="sticky-nav,"
30
+ scroll-up="5"
31
+ scroll-down="5"
32
+ path="../"
33
+ src="../components/navbar.html"></nav>
34
+ <sidenav
35
+ id="menuL"
36
+ class="position:fixed top:0px left:0px overflow:hidden background:whitesmoke height:100vh width:0px width:300px@xl"
37
+ resizable
38
+ resize-query="[content_id='content']"
39
+ resize-property="margin-left"
40
+ resize-value="width">
41
+ <menu
42
+ array="files"
43
+ object="603717b07de7fb350ae9fec8"
44
+ key="src"></menu>
45
+ <div resize="right"></div>
46
+ </sidenav>
47
+ <main
48
+ class="padding-top:15px padding:15px@lg@xl"
49
+ content_id="content"
50
+ id="cocreate-crdt">
51
+ <div
52
+ class="display:flex flex-wrap:wrap justify-content:space-between margin:10px">
53
+ <div class="display:flex align-items:center">
54
+ <h2>CoCreate-crdt</h2>
55
+ </div>
56
+ <div
57
+ class="display:flex align-items:center font-size:20px"
58
+ share-height="600"
59
+ share-width="500"
60
+ share-media="https://via.placeholder.com/300/09f/fff.png">
61
+ <a
62
+ href="https://github.com/CoCreate-app/CoCreate-crdt"
63
+ target="_blank"
64
+ class="margin-right:15px"
65
+ ><i src="/assets/svg/github.svg"></i
66
+ ></a>
67
+ <a
68
+ class="margin-right:15px share"
69
+ share-network="twitter"
70
+ title="Share on twitter"
71
+ ><i src="/assets/svg/twitter.svg"></i
72
+ ></a>
73
+ <a
74
+ class="margin-right:15px share"
75
+ share-network="facebook"
76
+ title="Share on Facebook"
77
+ ><i src="/assets/svg/facebook.svg"></i
78
+ ></a>
79
+ <a
80
+ class="margin-right:15px share"
81
+ share-network="instagram"
82
+ title="Share on instagram"
83
+ ><i src="/assets/svg/instagram.svg"></i
84
+ ></a>
85
+ <a
86
+ class="margin-right:15px share"
87
+ share-network="share"
88
+ title="Share on share"
89
+ ><i src="/assets/svg/share-alt.svg"></i
90
+ ></a>
91
+ </div>
92
+ </div>
93
+ <p class="max-width:500px margin:20px_10px">
94
+ A headless vinilla javascript micro component. Easy
95
+ configuration using HTML5 attributes or Javscript api.
96
+ </p>
97
+ <div id="crdt-section" class="display:flex flex-wrap:wrap">
98
+ <div class="flex-grow:1 width:300px padding:20px_10px">
99
+ <h2
100
+ class="border-bottom:1px_solid_lightgrey padding:5px_0px">
101
+ Install
102
+ </h2>
103
+ <pre
104
+ class="margin-top:15px"><code class="language-javascript">npm install cocreate-crdt</code></pre>
105
+ <p class="padding:10px_0px">Or you can use cdn link:</p>
106
+ <pre><code class="language-javascript">https://cdn.cocreate.app/js/CoCreate-crdt.min.js</code></pre>
107
107
 
108
- <h2
109
- class="border-bottom:1px_solid_lightgrey margin-top:20px padding:5px_0px">
110
- Usage
111
- </h2>
112
- <p class="padding:10px_0px">crdt usage content</p>
113
- <pre><code class="language-html">&lt;div&gt;&lt;/div&gt;</code></pre>
108
+ <h2
109
+ class="border-bottom:1px_solid_lightgrey margin-top:20px padding:5px_0px">
110
+ Usage
111
+ </h2>
112
+ <p class="padding:10px_0px">crdt usage content</p>
113
+ <pre><code class="language-html">&lt;div&gt;&lt;/div&gt;</code></pre>
114
114
 
115
- <h2
116
- class="border-bottom:1px_solid_lightgrey margin-top:20px padding:5px_0px">
117
- Reference
118
- </h2>
119
- <p class="padding:10px_0px">
120
- This is crdt reference content
121
- </p>
122
- <pre><code class="language-javascript">&lt;div&gt;&lt;/div&gt;</code></pre>
123
- <p class="padding:10px_0px">
124
- This is crdt reference content
125
- </p>
115
+ <h2
116
+ class="border-bottom:1px_solid_lightgrey margin-top:20px padding:5px_0px">
117
+ Reference
118
+ </h2>
119
+ <p class="padding:10px_0px">
120
+ This is crdt reference content
121
+ </p>
122
+ <pre><code class="language-javascript">&lt;div&gt;&lt;/div&gt;</code></pre>
123
+ <p class="padding:10px_0px">
124
+ This is crdt reference content
125
+ </p>
126
126
 
127
- <h2
128
- class="border-bottom:1px_solid_lightgrey margin-top:20px padding:5px_0px">
129
- Attributes
130
- </h2>
131
- <ul class="list-style-type:none">
132
- <li
133
- class="padding:15px_0px border-bottom:1px_solid_lightgrey">
134
- <h4>
135
- <span>crdt</span>
136
- <span class="cocreate-badge success"
137
- >string</span
138
- >
139
- <span class="cocreate-badge warning"
140
- >optional</span
141
- >
142
- </h4>
143
- <p>crdt-attribute</p>
144
- </li>
145
- <li
146
- class="padding:15px_0px border-bottom:1px_solid_lightgrey">
147
- <h4>
148
- <span>crdt</span>
149
- <span class="cocreate-badge success"
150
- >string</span
151
- >
152
- <span class="cocreate-badge warning"
153
- >optional</span
154
- >
155
- </h4>
156
- <p>crdt-attribute</p>
157
- </li>
158
- </ul>
159
- </div>
127
+ <h2
128
+ class="border-bottom:1px_solid_lightgrey margin-top:20px padding:5px_0px">
129
+ Attributes
130
+ </h2>
131
+ <ul class="list-style-type:none">
132
+ <li
133
+ class="padding:15px_0px border-bottom:1px_solid_lightgrey">
134
+ <h4>
135
+ <span>crdt</span>
136
+ <span class="cocreate-badge success"
137
+ >string</span
138
+ >
139
+ <span class="cocreate-badge warning"
140
+ >optional</span
141
+ >
142
+ </h4>
143
+ <p>crdt-attribute</p>
144
+ </li>
145
+ <li
146
+ class="padding:15px_0px border-bottom:1px_solid_lightgrey">
147
+ <h4>
148
+ <span>crdt</span>
149
+ <span class="cocreate-badge success"
150
+ >string</span
151
+ >
152
+ <span class="cocreate-badge warning"
153
+ >optional</span
154
+ >
155
+ </h4>
156
+ <p>crdt-attribute</p>
157
+ </li>
158
+ </ul>
159
+ </div>
160
160
 
161
- <div
162
- class="flex-grow:1 width:300px padding:0px_10px margin:20px_0px border-bottom:1px_solid_lightgrey">
163
- <!-- SandBox -->
164
- <h2
165
- class="border-bottom:1px_solid_lightgrey padding:5px_0px">
166
- Demo
167
- </h2>
168
- <div
169
- class="position:sticky top:0 padding:10px_0px height:100vh">
170
- <!-- SandBox -->
171
- <div
172
- class="display:flex flex-direction:column position:relative overflow:hidden card border-radius:2px width:auto height:600px margin-top:20px"
173
- id="playground">
174
- <div
175
- id="demo-code"
176
- resizable
177
- class="position:relative height:50%">
178
- <textarea
179
- type="code"
180
- lang="html"
181
- array="demos"
182
- object=""
183
- key="demo"
184
- save="false"
185
- id="demo"
186
- class="height:100% width:100% outline:none border:none resize:none padding:5px"></textarea>
187
- <div
188
- resize="bottom"
189
- class="background:lightgrey"></div>
190
- </div>
161
+ <div
162
+ class="flex-grow:1 width:300px padding:0px_10px margin:20px_0px border-bottom:1px_solid_lightgrey">
163
+ <!-- SandBox -->
164
+ <h2
165
+ class="border-bottom:1px_solid_lightgrey padding:5px_0px">
166
+ Demo
167
+ </h2>
168
+ <div
169
+ class="position:sticky top:0 padding:10px_0px height:100vh">
170
+ <!-- SandBox -->
171
+ <div
172
+ class="display:flex flex-direction:column position:relative overflow:hidden card border-radius:2px width:auto height:600px margin-top:20px"
173
+ id="playground">
174
+ <div
175
+ id="demo-code"
176
+ resizable
177
+ class="position:relative height:50%">
178
+ <textarea
179
+ type="code"
180
+ lang="html"
181
+ array="demos"
182
+ object=""
183
+ key="demo"
184
+ save="false"
185
+ id="demo"
186
+ class="height:100% width:100% outline:none border:none resize:none padding:5px"></textarea>
187
+ <div
188
+ resize="bottom"
189
+ class="background:lightgrey"></div>
190
+ </div>
191
191
 
192
- <div
193
- id="demo-preview"
194
- class="position:relative overflow:auto background-color:white">
195
- <div class="demopreview padding:20px"></div>
196
- </div>
192
+ <div
193
+ id="demo-preview"
194
+ class="position:relative overflow:auto background-color:white">
195
+ <div class="demopreview padding:20px"></div>
196
+ </div>
197
197
 
198
- <div
199
- class="font-size:20px position:absolute top:10px right:10px opacity:0.6">
200
- <a
201
- class="margin-right:10px"
202
- id="eye"
203
- show="#eye-slash"
204
- hide="#eye, #demo-preview"
205
- toggle="code-height"
206
- toggle-selector="#demo-code"
207
- ><i
208
- class="height:18px"
209
- src="/assets/svg/eye.svg"></i
210
- ></a>
211
- <a
212
- class="margin-right:10px"
213
- hidden
214
- id="eye-slash"
215
- show="#eye, #demo-preview"
216
- hide="#eye-slash"
217
- toggle="code-height"
218
- toggle-selector="#demo-code"
219
- ><i src="/assets/svg/eye-slash.svg"></i
220
- ></a>
221
- <a
222
- class="margin-right:10px"
223
- id="code"
224
- show="#code-slash"
225
- hide="#code, #demo-code"
226
- ><i src="/assets/svg/code.svg"></i
227
- ></a>
228
- <a
229
- class="margin-right:10px"
230
- hidden
231
- id="code-slash"
232
- show="#code, #demo-code"
233
- hide="#code-slash"
234
- ><i
235
- class="height:18px"
236
- src="/assets/svg/code.svg"></i
237
- ></a>
238
- <a
239
- class="margin-right:5px"
240
- fullscreen
241
- fullscreen-selector="#playground"></a>
242
- </div>
243
- </div>
244
- <!-- End SandBox -->
245
- </div>
246
- </div>
247
- </div>
248
- </main>
198
+ <div
199
+ class="font-size:20px position:absolute top:10px right:10px opacity:0.6">
200
+ <a
201
+ class="margin-right:10px"
202
+ id="eye"
203
+ show="#eye-slash"
204
+ hide="#eye, #demo-preview"
205
+ toggle="code-height"
206
+ toggle-query="#demo-code"
207
+ ><i
208
+ class="height:18px"
209
+ src="/assets/svg/eye.svg"></i
210
+ ></a>
211
+ <a
212
+ class="margin-right:10px"
213
+ hidden
214
+ id="eye-slash"
215
+ show="#eye, #demo-preview"
216
+ hide="#eye-slash"
217
+ toggle="code-height"
218
+ toggle-query="#demo-code"
219
+ ><i src="/assets/svg/eye-slash.svg"></i
220
+ ></a>
221
+ <a
222
+ class="margin-right:10px"
223
+ id="code"
224
+ show="#code-slash"
225
+ hide="#code, #demo-code"
226
+ ><i src="/assets/svg/code.svg"></i
227
+ ></a>
228
+ <a
229
+ class="margin-right:10px"
230
+ hidden
231
+ id="code-slash"
232
+ show="#code, #demo-code"
233
+ hide="#code-slash"
234
+ ><i
235
+ class="height:18px"
236
+ src="/assets/svg/code.svg"></i
237
+ ></a>
238
+ <a
239
+ class="margin-right:5px"
240
+ fullscreen
241
+ fullscreen-query="#playground"></a>
242
+ </div>
243
+ </div>
244
+ <!-- End SandBox -->
245
+ </div>
246
+ </div>
247
+ </div>
248
+ </main>
249
249
 
250
- <script src="https://CoCreate.app/dist/CoCreate.js"></script>
251
- </body>
250
+ <script src="https://CoCreate.app/dist/CoCreate.js"></script>
251
+ </body>
252
252
  </html>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/crdt",
3
- "version": "1.27.6",
3
+ "version": "1.28.1",
4
4
  "description": "CoCreate crdt",
5
5
  "author": "CoCreate LLC",
6
6
  "license": "AGPL-3.0",
@@ -27,21 +27,17 @@
27
27
  },
28
28
  "main": "./src/index.js",
29
29
  "devDependencies": {
30
- "@babel/core": "^7.9.6",
31
- "@babel/preset-env": "^7.9.6",
32
- "babel-loader": "^8.1.0",
33
- "clean-webpack-plugin": "^3.0.0",
34
- "file-loader": "^6.2.0",
30
+ "css-loader": "^5.1.3",
31
+ "esbuild": "^0.25.2",
32
+ "esbuild-loader": "^4.3.0",
35
33
  "mini-css-extract-plugin": "^1.5.0",
36
- "style-loader": "^3.3.1",
37
- "terser-webpack-plugin": "^5.1.1",
38
34
  "webpack": "^5.24.4",
39
35
  "webpack-cli": "^4.5.0",
40
36
  "webpack-log": "^3.0.1"
41
37
  },
42
38
  "dependencies": {
43
- "@cocreate/crud-client": "^1.33.9",
44
- "@cocreate/local-storage": "^1.15.0",
45
- "@cocreate/utils": "^1.33.7"
39
+ "@cocreate/crud-client": "^1.34.1",
40
+ "@cocreate/local-storage": "^1.16.1",
41
+ "@cocreate/utils": "^1.38.0"
46
42
  }
47
43
  }
@@ -0,0 +1,16 @@
1
+ module.exports = {
2
+ tabWidth: 4,
3
+ semi: true,
4
+ trailingComma: "none",
5
+ bracketSameLine: true,
6
+ useTabs: true,
7
+ overrides: [
8
+ {
9
+ files: ["*.json", "*.yml", "*.yaml"],
10
+ options: {
11
+ tabWidth: 2,
12
+ useTabs: false
13
+ },
14
+ }
15
+ ],
16
+ };
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-crdt": "./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", "crdt"],
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-crdt": "./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", "crdt"],
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
+ };