GithubHelp home page GithubHelp logo

elemefe / cooking Goto Github PK

View Code? Open in Web Editor NEW
1.9K 78.0 289.0 2.28 MB

👨‍🍳 更易上手的前端构建工具

Home Page: http://elemefe.github.io/cooking/

License: MIT License

JavaScript 98.86% Makefile 1.04% Shell 0.10%
webpack vue build react cooking

cooking's Introduction

cooking

A front-end build tool that comes handy

Build Status Coverage Status npm npm Gitter

Links

Discussion

Hit Gitter if you come across any problem while using cooking. Issues are only for bug reports and feature requests.

Features

  • Simplified webpack configuring with humanistic parameters
  • Use cooking CLI to efficiently scaffold projects without installing dependencies repeatedly (based on webpack 2)
  • Compatible with both webpack 1 and 2 with just one set of configuration
  • Generated configuration fully compatible with webpack CLI

Installation

runtime environment

  • Node.js 4+
  • npm 3+
  • Python 2.7.x

Using cooking CLI

npm i cooking-cli -g

Step 1. create a vue-based project (vue scaffold will be downloaded automatically if not installed)

$ cooking create my-project vue
$ cd my-project

Step 2. start developing

$ cooking watch

Using cooking core

npm i cooking -D

# install webpack dependencies (take webpack 1 for example)
npm i babel-core babel-loader css-loader file-loader postcss postcss-loader\
 html-loader html-webpack-plugin json-loader style-loader url-loader\
 webpack@1 webpack-dev-server@1 extract-text-webpack-plugin@1 -D

# or install webpack dependencies (take webpack 2)
npm i babel-core babel-loader css-loader file-loader postcss postcss-loader\
 html-loader html-webpack-plugin json-loader style-loader url-loader\
 webpack webpack-dev-server [email protected] -D

# start developing
node_modules/.bin/cooking watch # or webpack --config cooking.conf.js

# if cooking-cli is globally installed, you can also do this (it still runs your local cooking)
cooking watch

License

MIT

cooking's People

Contributors

furybean avatar hsunboy avatar leopoldthecoder avatar nyaapass avatar qingwei-li avatar tiye avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cooking's Issues

加载less模块失败

系统: win7
Node: 5.12
Npm: 3.8.6
cooking: 1.0.7

一切按提示安装, css处理那里选择了 less, watch的时候报错
image

.cooking\node_modules\cooking-less\less-loader.js

  // if (nextVersion) {
  //   nextVersion = Number(nextVersion.split('.')[0])
  // }

没看明白这三行代码的作用, 注释后运行成功...

coding 那个工具安装上之后,无法新建项目 报如下的错误

C:\Program Files\nodejs\node_modules\cooking\bin\cooking:4
const path = require('path') ^^^^^
SyntaxError: Use of const in strict mode.
at exports.runInThisContext (vm.js:73:16)
at Module._compile (module.js:443:25)
at Object.Module._extensions..js (module.js:478:10) a
t Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:501:10)
at startup (node.js:129:16) at node.js:814:3

npm run cooking watch报错

操作系统win7,报错信息:

D:\wwwroot\cy-ui>npm run cooking watch

> [email protected] cooking D:\wwwroot\cy-ui
> cooking "watch"

[cooking] - 插件加载成功: vue2

[cooking] - server 启动中...
[cooking] - Listening at http://localhost:8888
Child cooking.conf.js:
    Child html-webpack-plugin for "index.html":

webpack: bundle is now VALID.

cooking.conf.js 配置信息

var cooking = require('cooking');

cooking.set({
    entry: './src/main.js',
    dist: './dist',
    hash: true,
    sourceMap: true,
    template: './index.html', // 加载 index.html 模板
    devServer: { // 开启 webpack-dev-server
        port: 8888, // 端口为 8888
        publicPath: '/' // 开启 dev-server 时默认打包的资源文件路径是和 index.html 同级的
    },
    extends: ['vue2'] // 加载 cooking-vue2,自动配置 Vue 2.0 相关内容
})

module.exports = cooking.resolve();

mac下 sudo安装全局的cooking,但是并不能正常使用

安装过程提示:

[email protected]: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.

然后跑个cooking命令就报错:

fs.js:842
  return binding.mkdir(pathModule._makeLong(path),
                 ^

Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/cooking/.cooking'
    at Error (native)
    at Object.fs.mkdirSync (fs.js:842:18)
    at Object.exports.initPluginPackage (/usr/local/lib/node_modules/cooking/util/check.js:19:8)
    at Object.<anonymous> (/usr/local/lib/node_modules/cooking/bin/cooking:15:7)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Function.Module.runMain (module.js:447:10)
    at startup (node.js:141:18)

will fail on node releases >= v7.0 感觉这个怪怪的。难道是这个的关系?

权限报错?

npm的版本是3.9

image

直接输cooking -v也是报这个错。。

搭建react的时候报错

C:\Users\user\Desktop\react-cooking>cooking watch

[cooking] - 插件加载成功: react
[cooking] - 插件加载成功: lint
[cooking] - 插件加载成功: postcss

[cooking] - server 启动中...
[cooking] - Listening at http://localhost:8080
Child cooking.conf.js:

ERROR in ./src/app.js
Module build failed: ReferenceError: [BABEL] C:\Users\user\Desktop\react-coo

king\src\app.js: Unknown option: C:\Users\user\Desktop\react-cooking\node_module
s\react\react.js.Children. Check out http://babeljs.io/docs/usage/options/ for m
ore info

估计是编译的问题

支持将 cooking 安装在项目里

目前 cooking 只能全局安装,但是随着版本迭代,也出现了需要使用不同版本依赖的问题。因此从下一版开始将支持安装 cooking 在本地项目。

支持版本 0.7.0 和 1.0.0

计划是 1.0.0 只提供 webpack 2,0.7.x 只提供 webpack 1。同时如果安装在项目里的话,自动安装的 cooking 依赖将会保存在 package.json 中。并不能使用全局的 cooking 依赖。同时也可以自己管理依赖的其他版本。

Cannot find module 'cooking-vue'

node 6.2.1、 npm 3.9.3 环境下安装cooking, 前面执行都正常,到cooking watch 这步时会报错「Error: Failed to read the config. Error: Cannot find module 'cooking-vue'」 请问是什么问题?

eslint-config-standard已经安装了。不知道为啥不好用呢 nodejs-v6.0.0 npm-v3.8.6

ERROR in ./src/main.js
Module build failed: Error: Cannot find module 'eslint-config-standard'
Referenced from: D:\nodejs\api.bluemark.cn\static\.eslintrc.js
    at Object.ModuleResolver.resolve (C:\Users\Adiministrator\.cooking\node_modules\eslint\lib\util\module-resolver.js:77:19)
    at resolve (C:\Users\Adiministrator\.cooking\node_modules\eslint\lib\config\config-file.js:475:33)
    at load (C:\Users\Adiministrator\.cooking\node_modules\eslint\lib\config\config-file.js:492:24)
    at C:\Users\Adiministrator\.cooking\node_modules\eslint\lib\config\config-file.js:388:36
    at Array.reduceRight (native)
    at applyExtends (C:\Users\Adiministrator\.cooking\node_modules\eslint\lib\config\config-file.js:365:28)
    at Object.load (C:\Users\Adiministrator\.cooking\node_modules\eslint\lib\config\config-file.js:527:22)
    at loadConfig (C:\Users\Adiministrator\.cooking\node_modules\eslint\lib\config.js:67:33)
    at getLocalConfig (C:\Users\Adiministrator\.cooking\node_modules\eslint\lib\config.js:129:23)
    at Config.getConfig (C:\Users\Adiministrator\.cooking\node_modules\eslint\lib\config.js:230:22)
    at processText (C:\Users\Adiministrator\.cooking\node_modules\eslint\lib\cli-engine.js:149:27)
    at CLIEngine.executeOnText (C:\Users\Adiministrator\.cooking\node_modules\eslint\lib\cli-engine.js:666:26)
    at lint (C:\Users\Adiministrator\.cooking\node_modules\eslint-loader\index.js:25:20)
    at Object.module.exports (C:\Users\Adiministrator\.cooking\node_modules\eslint-loader\index.js:111:3)
 @ multi app
Child html-webpack-plugin for "index.html":

禁止使用 sudo 执行但是普通用户执行又显示permission denied

以普通用户身份运行的时候显示一下错误:

fs.js:794
  return binding.mkdir(pathModule._makeLong(path),
                 ^
Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/.cooking_npminstall/cooking/0.4.2/cooking/.cooking'

切换到sudo之后又提示禁止使用 sudo

我的环境是MAC OSX10.11.4

多入口资源加载问题

我有两个入口,src/index.tpl和src/pages/activity/activity.tpl,为什么index.tpl入口会加载activity.js,activity.tpl会加载app.js(index.tpl下js文件)
a
b
c

d

0.3.0

feature

  • 移除 provide 变量,需要引用 webpack 等插件直接通过

var webpack = require('cooking/lib/webpack')

var webpack = require('webpack') // 直接 require 也能访问到 🌚
# 安装 vue, sass 插件
$ cooking import vue sass
cooking.set({
  extends: ['vue', 'sass']
})
  • 命令模块化,将 test, deploy 等指令以插件的形式安装
# 安装 test 命令
$ cooking import test-cli

# 查看命令
$ cooking

...
watch                开发模式
build                构建模式
test                 测试命令
...
  • 更新模块
$ cooking update vue sass
  • 插件通过 import, update, remove 的方式操作,所有插件保存到 cooking/.cooking 目录下
  • 支持配置默认参数

待开发插件列表

  • cooking-postcss 提供 postcss-loader 及其基本插件
  • cooking-jade(pug)
  • cooking-salad

...

cooking watch 报错

执行 cooking watch 之后就这么报错了。

[cooking] - 安装成功

[cooking] - Failed to read the config.
[cooking] - Error: Cannot find module 'cooking/util/check'
    at Function.Module._resolveFilename (module.js:326:15)
    at Function.Module._load (module.js:277:25)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/home/leung/.cooking/node_modules/cooking-vue/css-loader.js:2:21)
    at Module._compile (module.js:410:26)
    at Object.Module._extensions..js (module.js:417:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/home/leung/.cooking/node_modules/cooking-vue/index.js:1:79)
    at Module._compile (module.js:410:26)
    at Object.Module._extensions..js (module.js:417:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)

删除~/.cooking也不行。
不是sudo安装cooking
Linux: ubuntu16.04
NPM:3.5.2

cooking 安装后不能运行

node版本 V5.5.0
npm版本 v3.7.0
操作系统 ubuntu 14.04
安装cooking 后 执行报错

  return binding.mkdir(pathModule._makeLong(path),
                 ^

Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/cooking/.cooking'
    at Error (native)
    at Object.fs.mkdirSync (fs.js:842:18)
    at Object.exports.initPluginPackage (/usr/local/lib/node_modules/cooking/util/check.js:19:8)
    at Object.<anonymous> (/usr/local/lib/node_modules/cooking/bin/cooking:14:7)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Function.Module.runMain (module.js:447:10)
    at startup (node.js:139:18)

执行加上sudo后,显示

[cooking] - 禁止使用 sudo 执行

_这是出了什么问题呢?_

1.0.0-beta

新特性

1. 使用 webpack 2.0-beta

具体用法参考 https://github.com/webpack/webpack/tree/master/examples

2. 内置 postcss 以及 postcss 配置

现在可以更加方便的使用 postcss,传入参数是数组类型。同时 cooking-postcss 作废

cooking.set({
  postcss: [
    require('postcss-plugin'),
    require('autoprefixer') // 如果使用 vue-loader^8.0.0 需要手动关掉里面的 autoprefixer
    // xxx
  ]
})

// cooking.add('vue.autoprefixer', false)

当然 autoprefixer 作为常用依赖,也将抽离成 cooking 的一个插件(并已经关掉了 vue-loader 里的 autoprefixer),使用方法

cooking.set({
  //...
  extends: ['vue', 'autoprefixer']
})

3. extends 支持数组的形式传参数

cooking.set({
  extends: [
    'vue',
    ['autoprefixer', {browsers: ['last 2 versions']}]
  ]
})

4. minimize ( build 模式)

接受 boolean 或 object,默认 css 和 js 都压缩

cooking.set({
  minimize: true // 默认值
}) 

cooking.set({
  // 分别设置 js 和 css
  minimize: {
    js: true,
    css: true
  }
}) 

修改的逻辑

1. extends 现在有执行顺序,将从右往左执行

例如如果 vue 和 autoprefixer 搭配使用,应该先使用 autoprefixer 最后才是 vue

cooking.set({
  extends: ['vue', 'autoprefixer']
})

升级方式

完全向下兼容

安装

npm i cooking@beta -g

清理 ~/.cooking 下的插件并重新安装

何时正式版

webpack 出了正式版再说

TODO

  • 补全测试
  • 升级所有所有插件兼容 0.x 和 1.0
    • cooking-sass
    • cooking-lint
    • slush-cooking-vue
    • cooking-vue
    • cooking-react
    • cooking-less
    • cooking-salad
    • cooking-postcss (1.0 的给警告提示)
  • 支持测试指令

This is an issue with the `slush-cooking-vue` generator

cooking create my-project vue

..............

[cooking] - generator project
[18:00:21] No local gulp install found in /Users/Writer/.cooking/node_modules/slush-cooking-vue
[slush] This is an issue with the slush-cooking-vue generator

npm install slush-cooking-vue -g

问题依旧

运行报错

你好,装好了,cooking,但是一运行,就报错了

window系统资源bug

windows系统上载入css,img,fonts等资源时,会自动在url上使用windows风格的分隔符 \
会导致资源路径错误

cooking.add('loader.font', {
    test: /\.otf|ttf|woff2?|eot(\?\S*)?$/,
    loader: 'url-loader',
    query: {
        limit: 10000,
        name:  path.posix.join('./','asset/','[name].[hash:7].[ext]')
    }
});

我使用 path.posix.join 可以解决这个问题 , 你看怎么处理呢

增加 use 配置参数

当前 extends 的定义是提供预配置和相关依赖。这里的相关依赖是把 dev 和 prod 的依赖都囊括了,导致配置结果不够友好

{
    extends: ['vue']
}

对于用户来说认为这里只是提供了 vue 的配置(以及配置所需要的依赖),除此之外的东西不清楚有没有提供(其实是也包含在内了的)。所以这里考虑将其拆分成两个参数。

  • use
  • extends

其中 use 负责引入生产上需要的依赖,例如 vue 大礼包, extends 只负责配置及配置相关的依赖,例如 vue-loader,新的配置如下

{
  use: 'vue',
  extends: ['vue']
}

@luxiaojian

npm link cooking

这个可能并不靠谱,用户安装的 cooking 有可能是通过 cnpm 安装的,这样就 link 到了一个空的目录。

可能通过 which cooking,然后再执行 ln -s path 比较靠谱。

add .gitignore

init的时候加一波.gitignore,自己就不用新建了

两个bug

  • 安装后需要 sudo 执行,否则报错
permission denied, open '/Users/younger/.config/configstore/update-notifier-cooking.json'
  • build 出的 dist 目录同样需要 sudo 才能删除
  • html template配置需要优化。

如何去除es-lint的格式限制?

  ✘  http://eslint.org/docs/rules/space-before-function-paren  Unexpected space before function parentheses  
  G:\html\workspace\vue-blog\src\pages\newpost.vue:7:7
    data () {
         ^

  ✘  http://eslint.org/docs/rules/semi                         Missing semicolon                             
  G:\html\workspace\vue-blog\src\pages\newpost.vue:8:14
      return {}
                ^

  ✘  http://eslint.org/docs/rules/space-before-function-paren  Unexpected space before function parentheses  
  G:\html\workspace\vue-blog\src\pages\newpost.vue:11:8
    ready () {},
          ^

  ✘  http://eslint.org/docs/rules/space-before-function-paren  Unexpected space before function parentheses  
  G:\html\workspace\vue-blog\src\pages\newpost.vue:12:11
    attached () {},
             ^

  ✘  http://eslint.org/docs/rules/semi                         Missing semicolon                             
  G:\html\workspace\vue-blog\src\pages\newpost.vue:15:2
  }
    ^


✘ 5 problems (5 errors, 0 warnings)

感觉es-lint的格式限制太多了。不想使用它的语法检查,请问如何去除?

cooking watch报错

cooking-cli是安装在全局的。然后执行watch就报错了

D:\wwwroot\cy-ui>cooking watch


[cooking] - Failed to read the config.
[cooking] - ReferenceError: modules is not defined
    at Object.<anonymous> (D:\wwwroot\cy-ui\cooking.conf.js:10:1)
    at Module._compile (module.js:398:26)
    at Object.Module._extensions..js (module.js:405:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)
    at module.exports (D:\wwwroot\cy-ui\node_modules\cooking\util\load-config.js
:18:14)
    at D:\wwwroot\cy-ui\node_modules\cooking\bin\cooking-watch:24:12
    at Array.forEach (native)
    at Object.<anonymous> (D:\wwwroot\cy-ui\node_modules\cooking\bin\cooking-wat
ch:23:16)
    at Module._compile (module.js:398:26)
    at Object.Module._extensions..js (module.js:405:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Function.Module.runMain (module.js:430:10)

cooking build failed

npm i cooking-cli -g是这样安装的,安装后cooking watch没问题,cooking build失败

cooking version

1.1.1

What is actually happening?

cooking build

[cooking] - Loaded success: autoprefixer
[cooking] - Failed to read the config.
[cooking] - Error: Breaking change: extract now only takes a single argument. Either an options object or the loader(s).
Example: if your old code looked like this:
ExtractTextPlugin.extract('style-loader', 'css-loader')

You would change it to:
ExtractTextPlugin.extract({ fallbackLoader: 'style-loader', loader: 'css-loader' })

The available options are:
loader: string | object | loader[]
fallbackLoader: string | object | loader[]
publicPath: string

cooking 1.0 正式版介绍

回顾

经历了三个月的迭代,逐渐发现了一些重大的设计失误。比如全局安装了插件后没发很好的做版本管理。插件到好办,主要是 cooking 一些核心的依赖,例如 babel 和 webpack 就没办法指定版本。同时如果 webpack 2 正式版出来后,按照原来的思路是需要维护两个版本的 cooking,这样导致重复代码太多,同时插件也要兼容两种版本。所以必定要重构。

要解决的问题

  • 保留原来的全局安装的依赖的特性;同时支持本地安装 cooking 然后自己管理其他依赖,也就是需要 cooking 提供简洁配置的特性
  • 可选择使用 webpack 1 和 webpack 2,两本版本中不兼容的 API 都会在 cooking 里做处理
  • 丰富配置项:提供 postcss、alias 和 externals 的配置项
    #1.0.0 ✌️

新特性

  • 目前 cooking 提供 cookingcooking-cli 两个包。区别是前者提供配置功能,以及 build 和 watch 指令,但是不提供依赖,只能安装在本地。后者是提供了完整的指令,例如create, init, config, update 等,同时全局安装了依赖
  • cooking-clicooking 可以和睦相处,也可以只用其中一个,但是 cooking-cli 只提供 webpack 2
  • 新增的配置项有:
    • postcss(Array|Function) 配置 postcss
    • alias(Object) webpack 的 alias 配置项
    • externals(Object) webpack 的 externals 配置项
    • minimize(Boolean|Object) 设置是否压缩 js 或者 css 代码

用法

待补充

cooking init vue无反应

执行cooking init vue
[cooking] - 下载脚手架相关依赖
[cooking] - downloading 'slush-cooking-vue'
[cooking] - 脚手架安装成功

[cooking] - generator project
然后文件夹下没有任何反应

手动安装 npm install slush-cooking-vue报错

npm ERR! tar.unpack untar error C:\Users\Cacivy\AppData\Roaming\npm-cache\slush-cooking-vue\0.1.8\package.tgz****

这个怎么解决

ERROR in Missing binding /Users/kevinli/.cooking/node_modules/node-sass/vendor/darwin-x64-47/binding.node
    Node Sass could not find a binding for your current environment: OS X 64-bit with Node.js 5.x

    Found bindings for the following environments:
      - OS X 64-bit with Node.js 6.x

    This usually happens because your environment has changed since running `npm install`.
    Run `npm rebuild node-sass` to build the binding for your current environment.
     @ /Users/kevinli/.cooking/~/vue-style-loader!/usr/local/lib/~/cooking/~/css-loader!/Users/kevinli/.cooking/~/vue-loader/lib/style-rewriter.js!/Users/kevinli/.cooking/~/sass-loader?indentedSyntax!/Users/kevinli/.cooking/~/vue-loader/lib/selector.js?type=style&index=0!./src/app.vue 4:14-347 13:2-17:4 14:20-353
    Child html-webpack-plugin for "index.html":

cooking watch指令报错 没解决

执行 cooking watch指令 显示

[cooking] - 插件加载成功: vue
[cooking] - 插件加载成功: lint

[cooking] - server 启动中...
[cooking] - Listening at http://localhost:8080
Child cooking.conf.js:

    ERROR in Cannot find module './lib/source-map-generator'
     @ multi app

    ERROR in /Users/kevinli/~/webpack-dev-server/~/sockjs-client/~/json3/lib/json3.js
    Module parse failed: /Users/kevinli/node_modules/webpack-dev-server/node_modules/sockjs-client/node_modules/json3/lib/json3.js Line 778: Unexpected end of input
    You may need an appropriate loader to handle this file type.
    |               // Parses a JSON object, returning a new JavaScript object.
    |               results = {};
    |
     @ /Users/kevinli/~/webpack-dev-server/~/sockjs-client/lib/main.js 7:12-28
    Child html-webpack-plugin for "index.html":

webpack: bundle is now VALID.

Atom的ESlint报错

Atom编辑器,初始化一个vue项目,然后打开项目中的js文件,提示Error: Failed to load plugin vue: Cannot find module 'eslint-plugin-vue'

cooking build 错误,beta.2

在 ArchLinux , Windows 10 尝试都出现这个问题。
可以执行 watch ,cooking build 就出现这个。
代码是初始化代码,一句没动。
环境,错误信息如下

➜  ~ node -v; npm -v; npm list -g --depth=0 cooking
v6.3.1
3.10.5
/usr/lib
├── [email protected]
➜  vue-demo1 npm run dist                                                                                              

> [email protected] dist /home/archlinux/Codes/javascript/vue-demo1                                                      
> cooking build -p                                                                                                     


[cooking] - 插件加载成功: lint                                                                                               
[cooking] - 插件加载成功: vue                                                                                                

 71% sealingError: Chunk.entry was removed. Use hasRuntime()                                                           
    at Chunk.Object.defineProperty.get (/usr/lib/node_modules/cooking/node_modules/webpack/lib/Chunk.js:34:9)          
    at /usr/lib/node_modules/cooking/node_modules/extract-text-webpack-plugin/index.js:201:13                          
    at Array.filter (native)                                                                                           
    at Compilation.<anonymous> (/usr/lib/node_modules/cooking/node_modules/extract-text-webpack-plugin/index.js:200:37)
    at Compilation.applyPlugins (/usr/lib/node_modules/cooking/node_modules/tapable/lib/Tapable.js:25:14)              
    at Compilation.seal (/usr/lib/node_modules/cooking/node_modules/webpack/lib/Compilation.js:533:7)                  
    at Compiler.<anonymous> (/usr/lib/node_modules/cooking/node_modules/webpack/lib/Compiler.js:436:15)                
    at /usr/lib/node_modules/cooking/node_modules/tapable/lib/Tapable.js:152:11                                        
    at Compilation.<anonymous> (/usr/lib/node_modules/cooking/node_modules/webpack/lib/Compilation.js:438:10)          
    at /usr/lib/node_modules/cooking/node_modules/webpack/lib/Compilation.js:414:12                                    
    at /usr/lib/node_modules/cooking/node_modules/webpack/lib/Compilation.js:326:10                                    
    at /usr/lib/node_modules/cooking/node_modules/async/lib/async.js:52:16                                             
    at done (/usr/lib/node_modules/cooking/node_modules/async/lib/async.js:246:17)                                     
    at /usr/lib/node_modules/cooking/node_modules/async/lib/async.js:44:16                                             
    at /usr/lib/node_modules/cooking/node_modules/webpack/lib/Compilation.js:326:10                                    
    at /usr/lib/node_modules/cooking/node_modules/async/lib/async.js:52:16                                             

cooking watch error

E:\work\env\html5\cooking-cli>cooking watch

[cooking] - 插件加载成功: autoprefixer
[cooking] - 插件加载成功: less
[cooking] - 插件加载成功: lint
[cooking] - 插件加载成功: vue

[cooking] - server 启动中...
[cooking] - Listening at http://localhost:8080
'"[object Object]"' is not recognized as an internal or external command,
operable program or batch file.

cooking build 出错了

[cooking] - 插件加载成功: vue
[cooking] - 插件加载成功: lint
[cooking] - 插件加载成功: sass

G:\node_modules\global\node_modules\cooking\bin\cooking-build:72
    logger.err(err)
           ^

TypeError: logger.err is not a function
    at G:\node_modules\global\node_modules\cooking\bin\cooking-build:72:12
    at G:\node_modules\global\node_modules\cooking\node_modules\webpack\lib\MultiCompiler.js:104:18
    at G:\node_modules\global\node_modules\cooking\node_modules\async\lib\async.js:52:16
    at G:\node_modules\global\node_modules\cooking\node_modules\async\lib\async.js:361:13
    at G:\node_modules\global\node_modules\cooking\node_modules\async\lib\async.js:52:16
    at done (G:\node_modules\global\node_modules\cooking\node_modules\async\lib\async.js:241:17)
    at G:\node_modules\global\node_modules\cooking\node_modules\async\lib\async.js:44:16
    at G:\node_modules\global\node_modules\cooking\node_modules\async\lib\async.js:358:17
    at Compiler.<anonymous> (G:\node_modules\global\node_modules\cooking\node_modules\webpack\lib\Compiler.js:185:21)
    at Compiler.emitFiles (G:\node_modules\global\node_modules\cooking\node_modules\webpack\lib\Compiler.js:233:18)
    at G:\node_modules\global\node_modules\cooking\node_modules\mkdirp\index.js:47:53
    at FSReqWrap.oncomplete (fs.js:82:15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.