V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
爱意满满的作品展示区。
sensui7

又双叒叕一个 JS 项目生成器

  •  
  •   sensui7 · Dec 3, 2017 · 4001 views
    This topic created in 3066 days ago, the information mentioned may be changed or developed.

    准确的说这是一个自动脚本, 它不光生成 package.json, 而实际上运行 npm install 或者 yarn add.

    比如 sga -j, 一条命令, 接下来就可以直接运行yarn test了, jest 已经装好, 一个默认的 testcase 已经写好.

    现在可以支持

    • eslint (standard 规则)
    • babel (不支持 cli, 因为觉得意义不大, 可以自己自行安装 babel-cil 或 babel-register)
    • mocha with chai
    • jest
    • postcss (不支持单独安装, 安装 webpack 任务)
    • webpack (含所有, 使用了 stylus, 无 sass)
    • webpack with vue (最全的, 使用了 stylus, 无 sass)

    下次想写 js, 不用配置那些劳什子, 想要 eslint 直接 sga -e, 搞定, 想要写 vue 全家桶, 直接 sga -v.

    安装

    npm install -g sga
    // or
    yarn global add sga
    

    需要 node 8.0 以上, 最好安装 yarn

    主页: https://github.com/jacobsun/sga

    6 replies    2017-12-08 15:56:53 +08:00
    lxsunbin
        1
    lxsunbin  
       Dec 4, 2017
    总感觉你的头像哪里不对
    Jackliu
        2
    Jackliu  
       Dec 4, 2017
    支持
    Omooo
        3
    Omooo  
       Dec 5, 2017
    porn_hub?
    cycloid
        4
    cycloid  
       Dec 5, 2017
    总感觉你的头像哪里不对+1
    chenhonzhou
        5
    chenhonzhou  
       Dec 6, 2017
    楼上+2
    wfd0807
        6
    wfd0807  
       Dec 8, 2017
    楼上+ 3
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5636 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 77ms · UTC 08:24 · PVG 16:24 · LAX 01:24 · JFK 04:24
    ♥ Do have faith in what you're doing.