leanweb 1.2.6 → 1.2.9

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/README.md CHANGED
@@ -387,7 +387,6 @@ checkedValues = [];
387
387
  checked = false;
388
388
  toggleCheckbox() {
389
389
  this.checked = !this.checked;
390
- this.update();
391
390
  }
392
391
  ```
393
392
 
package/commands/build.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import fs from 'fs';
2
2
  import fse from 'fs-extra';
3
+ import { minify } from 'html-minifier';
3
4
  import * as utils from './utils.js';
4
5
  import * as parser from '../lib/lw-html-parser.js';
5
6
 
@@ -88,7 +89,14 @@ const require = createRequire(import.meta.url);
88
89
  }
89
90
  const styleString = cssString || '';
90
91
  const htmlString = fs.readFileSync(htmlFilename, 'utf8');
91
- const ast = parser.parse(htmlString);
92
+ const minifiedHtml = minify(htmlString, {
93
+ caseSensitive: true,
94
+ collapseWhitespace: true,
95
+ minifyCSS: true,
96
+ minifyJS: true,
97
+ removeComments: true,
98
+ });
99
+ const ast = parser.parse(minifiedHtml);
92
100
  ast.css = styleString;
93
101
  ast.componentFullName = project.name + '-' + cmp.replace(/\//g, '-');
94
102
  ast.runtimeVersion = project.version;
package/commands/dist.js CHANGED
@@ -2,7 +2,6 @@ import webpack from 'webpack';
2
2
  import * as utils from './utils.js';
3
3
  import fs from 'fs';
4
4
  import fse from 'fs-extra';
5
- // const minify = require('html-minifier').minify;
6
5
  import { minify } from 'html-minifier';
7
6
  import CleanCSS from 'clean-css';
8
7
 
@@ -49,7 +48,7 @@ if (args.length >= 3) {
49
48
  collapseWhitespace: true,
50
49
  minifyCSS: true,
51
50
  minifyJS: true,
52
- caseSensitive: true,
51
+ removeComments: true,
53
52
  });
54
53
  fs.writeFileSync(`./${utils.dirs.dist}/index.html`, minifiedIndexHtml);
55
54
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "leanweb",
3
- "version": "1.2.6",
3
+ "version": "1.2.9",
4
4
  "description": "Builds framework agnostic web components.",
5
5
  "bin": {
6
6
  "leanweb": "leanweb.js",
@@ -35,10 +35,10 @@
35
35
  "node-watch": "^0.7.3",
36
36
  "parse5": "^7.0.0",
37
37
  "raw-loader": "^4.0.2",
38
- "sass": "^1.54.3",
38
+ "sass": "^1.54.4",
39
39
  "sass-loader": "^13.0.2",
40
40
  "semver": "^7.3.7",
41
41
  "webpack": "^5.74.0",
42
- "webpack-dev-server": "^4.9.3"
42
+ "webpack-dev-server": "^4.10.0"
43
43
  }
44
44
  }
@@ -77,6 +77,7 @@ globalThis.addEventListener('hashchange', () => {
77
77
  leanweb.componentsListeningOnUrlChanges.forEach(component => {
78
78
  setTimeout(() => {
79
79
  component?.urlHashChanged?.call(component);
80
+ component?.update?.call(component);
80
81
  });
81
82
  });
82
83
  }, false);