goldwasserexchange/serverless-plugin-webpack

Can't load JSON

arb opened this issue · 2 comments

arb commented

Per https://github.com/webpack-contrib/json-loader#install I should no longer need the json-loader. However, every node_module that requires in package.json fails to parse.

ERROR in ./~/rollbar/package.json
    Module parse failed: /Users/xxx/Development/xxx/node_modules/rollbar/package.json Unexpected token (2:8)
    You may need an appropriate loader to handle this file type.
    SyntaxError: Unexpected token (2:8)
        at Parser.pp$4.raise (/Users/xxx/Development/xxx/node_modules/acorn/dist/acorn.js:2221:15)

Current webpack config:

const path = require('path');
module.exports = {
  target: 'node',
  externals: [
    /aws-sdk/,
  ],
  context: path.resolve(__dirname, 'handler')
};

Hi @arb,

This seems to be a webpack issue (no related to this plugin​). Can you share a bit more of your configuration (serverless.yml, package.json) ? Is your project public on GitHub ?

arb commented

It's a private project. We're using something else at the moment, so I'll close this for now.