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