【发布时间】: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