leanweb 1.2.7 → 1.3.0

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/commands/init.js CHANGED
@@ -103,7 +103,8 @@ const require = createRequire(import.meta.url);
103
103
  });
104
104
  console.log('\nSome useful commands:');
105
105
  console.log('"lw s" to start the dev server.');
106
- console.log('"lw d" to build for production. The output will be in dist/ directory.');
106
+ console.log('"lw di" to build for production. The output will be in dist/ directory.');
107
107
  console.log('"lw g my-new-component" to generate a new standard web component.');
108
+ console.log('"lw h" to get more help information.');
108
109
  }
109
110
  })();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "leanweb",
3
- "version": "1.2.7",
3
+ "version": "1.3.0",
4
4
  "description": "Builds framework agnostic web components.",
5
5
  "bin": {
6
6
  "leanweb": "leanweb.js",