leanweb 1.0.3 → 1.0.7

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/commands/build.js CHANGED
@@ -117,7 +117,7 @@
117
117
  const scssFileExists = fs.existsSync(scssFilename);
118
118
  let cssString = '';
119
119
  if (scssFileExists) {
120
- let scssString = `@import "global-styles.scss";\n`;
120
+ let scssString = `@use "global-styles.scss";\n`;
121
121
  scssString += fs.readFileSync(scssFilename, 'utf8');
122
122
  scssString += '\n[lw-false],[lw-for]{display:none !important;}\n';
123
123
  cssString = utils.buildCSS(scssString, `${projectPath}/${buildDir}/components/${cmp}`);
package/commands/serve.js CHANGED
@@ -10,7 +10,7 @@ if (args.length >= 3) {
10
10
  env = args[2];
11
11
  }
12
12
 
13
- const address = process.env.address || '127.0.0.1';
13
+ const host = process.env.host || '127.0.0.1';
14
14
  let port = process.env.port || 2020;
15
15
  const noopen = process.env.noopen || false;
16
16
 
@@ -54,19 +54,21 @@ const noopen = process.env.noopen || false;
54
54
 
55
55
  const compiler = webpack(webpackDevConfig);
56
56
 
57
+ while (await utils.portInUse(port, host)) {
58
+ ++port;
59
+ }
60
+
57
61
  const devServerOptions = {
58
62
  ...webpackDevConfig.devServer,
59
- contentBase: process.cwd() + `/${utils.dirs.serve}/`,
60
- watchContentBase: true,
61
- publicPath: '/',
62
- hot: true,
63
+ static: {
64
+ directory: process.cwd() + `/${utils.dirs.serve}/`,
65
+ watch: true,
66
+ },
67
+ port,
68
+ host,
63
69
  open: !noopen,
64
- stats: 'errors-warnings',
65
70
  };
66
- const server = new WebpackDevServer(compiler, devServerOptions);
71
+ const server = new WebpackDevServer(devServerOptions, compiler);
67
72
 
68
- while (await utils.portInUse(port, address)) {
69
- ++port;
70
- }
71
- server.listen(port, address);
73
+ server.start();
72
74
  })();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "leanweb",
3
- "version": "1.0.3",
3
+ "version": "1.0.7",
4
4
  "description": "Builds framework agnostic web components.",
5
5
  "bin": {
6
6
  "leanweb": "leanweb.js",
@@ -19,25 +19,25 @@
19
19
  "author": "Qian Chen",
20
20
  "license": "MIT",
21
21
  "dependencies": {
22
- "@babel/core": "^7.14.6",
23
- "@babel/parser": "^7.14.7",
24
- "@babel/plugin-transform-runtime": "^7.14.5",
25
- "@babel/preset-env": "^7.14.7",
26
- "babel-loader": "^8.2.2",
27
- "clean-css": "^5.1.3",
28
- "css-loader": "^6.2.0",
22
+ "@babel/core": "^7.16.5",
23
+ "@babel/parser": "^7.16.6",
24
+ "@babel/plugin-transform-runtime": "^7.16.5",
25
+ "@babel/preset-env": "^7.16.5",
26
+ "babel-loader": "^8.2.3",
27
+ "clean-css": "^5.2.2",
28
+ "css-loader": "^6.5.1",
29
29
  "fs-extra": "^10.0.0",
30
30
  "globby": "^11.0.4",
31
31
  "html-minifier": "^4.0.0",
32
- "isomorphic-git": "^1.9.2",
32
+ "isomorphic-git": "^1.10.3",
33
33
  "json5-loader": "^4.0.1",
34
- "node-watch": "^0.7.1",
34
+ "node-watch": "^0.7.2",
35
35
  "parse5": "^6.0.1",
36
36
  "raw-loader": "^4.0.2",
37
- "sass": "^1.35.2",
38
- "sass-loader": "^12.1.0",
37
+ "sass": "^1.45.1",
38
+ "sass-loader": "^12.4.0",
39
39
  "semver": "^7.3.5",
40
- "webpack": "^5.45.1",
41
- "webpack-dev-server": "^3.11.2"
40
+ "webpack": "^5.65.0",
41
+ "webpack-dev-server": "^4.7.1"
42
42
  }
43
43
  }