leanweb 1.0.2 → 1.0.6
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/init.js +6 -2
- package/commands/serve.js +13 -11
- package/commands/utils.js +0 -1
- package/package.json +15 -15
package/commands/init.js
CHANGED
|
@@ -91,7 +91,11 @@
|
|
|
91
91
|
name: 'Leanweb',
|
|
92
92
|
email: 'leanweb@leanweb.app',
|
|
93
93
|
},
|
|
94
|
-
message: '
|
|
95
|
-
})
|
|
94
|
+
message: 'lw init'
|
|
95
|
+
});
|
|
96
|
+
console.log('\nSome useful commands:');
|
|
97
|
+
console.log('"lw s" to start the dev server.');
|
|
98
|
+
console.log('"lw d" to build for production. The output will be in dist/ directory.');
|
|
99
|
+
console.log('"lw g my-new-component" to generate a new standard web component.');
|
|
96
100
|
}
|
|
97
101
|
})();
|
package/commands/serve.js
CHANGED
|
@@ -10,7 +10,7 @@ if (args.length >= 3) {
|
|
|
10
10
|
env = args[2];
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
const
|
|
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
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
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(
|
|
71
|
+
const server = new WebpackDevServer(devServerOptions, compiler);
|
|
67
72
|
|
|
68
|
-
|
|
69
|
-
++port;
|
|
70
|
-
}
|
|
71
|
-
server.listen(port, address);
|
|
73
|
+
server.start();
|
|
72
74
|
})();
|
package/commands/utils.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "leanweb",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
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.
|
|
23
|
-
"@babel/parser": "^7.
|
|
24
|
-
"@babel/plugin-transform-runtime": "^7.
|
|
25
|
-
"@babel/preset-env": "^7.
|
|
26
|
-
"babel-loader": "^8.2.
|
|
27
|
-
"clean-css": "^5.
|
|
28
|
-
"css-loader": "^5.
|
|
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
|
-
"globby": "^11.0.
|
|
30
|
+
"globby": "^11.0.4",
|
|
31
31
|
"html-minifier": "^4.0.0",
|
|
32
|
-
"isomorphic-git": "^1.
|
|
32
|
+
"isomorphic-git": "^1.10.2",
|
|
33
33
|
"json5-loader": "^4.0.1",
|
|
34
|
-
"node-watch": "^0.7.
|
|
34
|
+
"node-watch": "^0.7.2",
|
|
35
35
|
"parse5": "^6.0.1",
|
|
36
36
|
"raw-loader": "^4.0.2",
|
|
37
|
-
"sass": "^1.
|
|
38
|
-
"sass-loader": "^
|
|
37
|
+
"sass": "^1.45.0",
|
|
38
|
+
"sass-loader": "^12.4.0",
|
|
39
39
|
"semver": "^7.3.5",
|
|
40
|
-
"webpack": "^5.
|
|
41
|
-
"webpack-dev-server": "^
|
|
40
|
+
"webpack": "^5.65.0",
|
|
41
|
+
"webpack-dev-server": "^4.6.0"
|
|
42
42
|
}
|
|
43
43
|
}
|