heyui / hey-cli Goto Github PK
View Code? Open in Web Editor NEWhey-cli, webpack scaffolding,hot-dev-server,build
License: MIT License
hey-cli, webpack scaffolding,hot-dev-server,build
License: MIT License
就调整了一下
https://github.com/heyui/hey-cli/blob/master/src/task.js#L153
index 2d27d69..48dc415 100644
--- a/src/task.js
+++ b/src/task.js
@@ -152,10 +152,12 @@ module.exports = {
}
var jsonStats = stats.toJson();
if (jsonStats.errors.length > 0) {
- logger.error(jsonStats.errors);
+ //logger.error(jsonStats.errors);
+ jsonStats.errors.forEach((item) => logger.error(item));
}
if (jsonStats.warnings.length > 0) {
- logger.warn(jsonStats.warnings);
+ //logger.warn(jsonStats.warnings);
+ jsonStats.warnings.forEach((item) => logger.warn(item));
}
if(config.stat) {
fss.writeFile(webpackConfig.output.path + '/stat.json', JSON.stringify(jsonStats), function(err) {
本来提交了个PR,但是提交的用户错了,所以自己关掉了。
➜ hey-cli hey init react-test
HEY CLI v1.2.1
? Which template would you like to choose? React
[HEY] Use Template React
[HEY] Failed to download repo heyui/hey-cli-template: tunneling socket could not be established, cause=connect ECONNREFUSED 127.0.0.1:8118
[HEY] { Error: ENOENT: no such file or directory, scandir '/Users/wingsico/.hey-cli-template/react'
errno: -2,
code: 'ENOENT',
syscall: 'scandir',
path: '/Users/wingsico/.hey-cli-template/react' }
[HEY] Project react-test generation success.
====================================
cd react-test
npm install
hey dev
====================================
什么问题
文档中描述:
可以在hey.conf.js中webpack配置项中扩张(扩展?)配置以下属性:
plugins
module
尝试:
npm i --save-dev terser-webpack-plugin
const TerserPlugin = require('terser-webpack-plugin')
webpack:{
...
//代码混淆
plugins: [new TerserPlugin()],
....
}
报错:
HEY CLI v2.7.1
[HEY] Can't find hey.config.js or package.json 'hey' param.
请问:以terser-webpack-plugin插件为例,请问应该如何配置?
安装都正常,文件也没动。
然后 cmd 里输入 hey dev 回车,
结果打开了我的 sublime text,并打开了 hey.js 文件。
然后就没有然后了。
这是怎么回事呀,是要我卸载 sublime 或者修改 hey.js 吗?
如何使用vue jsx?
好像babel的配置是写死的,不能配置。
As I start a new heyAdmin project via hey-cli, naturally I expect to see a heyAdmin template option.
But the fact is NO, and I have to refer to https://heyui.github.io/heyui-admin-docs/#start and copy the commands to do so.
Appreciate if you can add heyAdmin template into hey-cli, many thanks :p
$ npm i -g hey-cli
npm WARN deprecated [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm ERR! Unexpected end of JSON input while parsing near '...ame":"loose-envify","'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\xxx\AppData\Roaming\npm-cache\_logs\2020-05-10T09_20_07_302Z-debug.log
###.log
580 silly fetchPackageMetaData error for loose-envify@^1.0.0 Unexpected end of JSON input while parsing near '...ame":"loose-envify","'
581 timing stage:rollbackFailedOptional Completed in 2ms
582 timing stage:runTopLevelLifecycles Completed in 15224ms
583 verbose stack SyntaxError: Unexpected end of JSON input while parsing near '...ame":"loose-envify","'
583 verbose stack at JSON.parse (<anonymous>)
585 verbose Windows_NT 10.0.18362
587 verbose node v8.11.4
588 verbose npm v6.14.5
589 error Unexpected end of JSON input while parsing near '...ame":"loose-envify","'
590 verbose exit [ 1, true ]
➜ node -v
v7.10.0
➜ npm -v
4.2.0
➜ hey -v
0.0.26
➜ hey init vue xman_ui
➜ hey dev
/usr/local/lib/node_modules/hey-cli/src/generatorWebpackConfig.js:114
new webpack.LoaderOptionsPlugin({
^
TypeError: webpack.LoaderOptionsPlugin is not a constructor
at initDefaultWebpackConf (/usr/local/lib/node_modules/hey-cli/src/generatorWebpackConfig.js:114:7)
at module.exports (/usr/local/lib/node_modules/hey-cli/src/generatorWebpackConfig.js:300:20)
at module.exports (/usr/local/lib/node_modules/hey-cli/src/config.js:62:21)
at Object.dev (/usr/local/lib/node_modules/hey-cli/src/task.js:16:18)
at Object.<anonymous> (/usr/local/lib/node_modules/hey-cli/bin/hey-dev.js:30:6)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.runMain (module.js:605:10)
at run (bootstrap_node.js:427:7)
at startup (bootstrap_node.js:151:9)
at bootstrap_node.js:542:3
如果在hey.config.js中添加module:{rules:[]},在generatorWebpackConfig.js中初始化好的rules会被覆盖掉。
if(webpackConfig.module) { for(var m in webpackConfig.module) { genWebpackConfig.module[m] = webpackConfig.module[m]; } }
但是我有需要手工添加rules,所以只能去修改generatorWebpackConfig.js的源码
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.