chokibasic 1.0.2 → 1.0.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Maxime Larrivée-Roy
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chokibasic",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Basic chokidar watcher + esbuild + sass + csso helpers",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
package/src/watcher.js CHANGED
@@ -205,7 +205,7 @@ function createWatchers(rules, options = {}) {
205
205
  }
206
206
 
207
207
 
208
- const buildCSS = async (inputScss, outCssMin) => {
208
+ const buildCSS = async (inputScss, outCssMin, options = {}) => {
209
209
  let compiled;
210
210
  try {
211
211
  compiled = sass.compile(inputScss, {
@@ -213,18 +213,19 @@ const buildCSS = async (inputScss, outCssMin) => {
213
213
  style: "compressed",
214
214
  sourceMap: false,
215
215
  sourceMapIncludeSources: false,
216
+ ...options
216
217
  });
218
+ const minified = csso.minify(compiled.css, { restructure: false });
219
+ fs.writeFileSync(outCssMin, minified.css);
220
+ console.log(`✅ CSS generated: ${outCssMin}`);
217
221
  } catch (err) {
218
222
  console.error("❌ Sass compile error:");
219
223
  console.error(err?.formatted || err?.message || err);
220
224
  }
221
- const minified = csso.minify(compiled.css, { restructure: false });
222
- fs.writeFileSync(outCssMin, minified.css);
223
- console.log(`✅ CSS generated: ${outCssMin}`);
224
225
  }
225
226
 
226
227
 
227
- const buildJS = async (entry, outfile) => {
228
+ const buildJS = async (entry, outfile, options = {}) => {
228
229
  try {
229
230
  await esbuild.build({
230
231
  entryPoints: [entry],
@@ -237,6 +238,7 @@ const buildJS = async (entry, outfile) => {
237
238
  supported: { "template-literal": false },
238
239
  target: ["es2020"],
239
240
  legalComments: "none",
241
+ ...options
240
242
  });
241
243
  console.log(`✅ JS generated: ${outfile}`);
242
244
  } catch (err) {