如何使用webpack的羽毛客户端

时间:2016-04-17 04:29:57

标签: webpack feathersjs

根据文档,我可以使用feathers/client但是当我尝试

让feather = require('feathers / client'); 让app = feathers();

由webpack编译,我得到了

./~/feathers/package.json
Module parse failed: /home/jiewmeng/Dropbox/expenses-app/node_modules/feathers/package.json Unexpected token (2:9)
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected token (2:9)
    at Parser.pp.raise (/home/jiewmeng/Dropbox/expenses-app/node_modules/webpack/node_modules/acorn/dist/acorn.js:918:13)
    at Parser.pp.unexpected (/home/jiewmeng/Dropbox/expenses-app/node_modules/webpack/node_modules/acorn/dist/acorn.js:1480:8)
    at Parser.pp.semicolon (/home/jiewmeng/Dropbox/expenses-app/node_modules/webpack/node_modules/acorn/dist/acorn.js:1459:73)

什么错了?

1 个答案:

答案 0 :(得分:3)

他们的客户端包含这样一行:

createApplication.version = require('../../package.json').version;

这将使webpack处理其项目的 package.json 。除非您设置了json-loader,否则这将失败。