【问题标题】:rollup, coffeescript issue when i dont use coffescript当我不使用咖啡脚本时汇总,咖啡脚本问题
【发布时间】:2017-11-06 16:17:54
【问题描述】:

尝试将汇总添加到我的 babel 代码库。

当我的代码没有咖啡脚本时,我收到与咖啡脚本相关的错误。我是新来的汇总,所以任何帮助将不胜感激

似乎是一个名为config 的库,但我不知道可能会使用它。

[!] Error: Could not resolve 'coffee-script' from /Users/terencechow/workspace/my-project/node_modules/config/lib/config.js
Error: Could not resolve 'coffee-script' from /Users/terencechow/workspace/my-project/node_modules/config/lib/config.js
    at /Users/terencechow/workspace/my-project/node_modules/rollup-plugin-node-resolve/dist/rollup-plugin-node-resolve.cjs.js:85:23
    at /Users/terencechow/workspace/my-project/node_modules/resolve/lib/async.js:50:13
    at processDirs (/Users/terencechow/workspace/my-project/node_modules/resolve/lib/async.js:182:39)
    at ondir (/Users/terencechow/workspace/my-project/node_modules/resolve/lib/async.js:197:13)
    at load (/Users/terencechow/workspace/my-project/node_modules/resolve/lib/async.js:80:43)
    at onex (/Users/terencechow/workspace/my-project/node_modules/resolve/lib/async.js:105:17)
    at /Users/terencechow/workspace/my-project/node_modules/resolve/lib/async.js:26:73
    at FSReqWrap.oncomplete (fs.js:112:15)

// rollup.config.js

import resolve from 'rollup-plugin-node-resolve'
import babel from 'rollup-plugin-babel'
import commonjs from 'rollup-plugin-commonjs'
import json from 'rollup-plugin-json'
import yaml from 'rollup-plugin-yaml'
import coffee from 'rollup-plugin-coffee-script'

export default {
  input: 'server/app.js',
  output: {
    file: 'dist/bundle.js',
    format: 'cjs'
  },
  plugins: [
    json(),
    yaml(),
    resolve({ extensions: [ '.js', '.json', .yaml', '.yml' ] }),
    commonjs({ extensions: [ '.js', '.json', '.yaml', '.yml' ] }),
    babel()
  ]
}

【问题讨论】:

    标签: javascript babeljs rollup


    【解决方案1】:

    这对我有用:

    npm i -D coffee-scriptyarn add -D coffee-script

    【讨论】:

      猜你喜欢
      • 2013-03-11
      • 2013-01-09
      • 1970-01-01
      • 2018-01-25
      • 1970-01-01
      • 2011-11-08
      • 2011-06-30
      • 2013-06-10
      • 2012-08-26
      相关资源
      最近更新 更多