question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Specifying a path to the package.json

See original GitHub issue

Hi there,

I was testing this plugin out and ran into some issue. We have a monorepo setup where the individual services do not have their own package.json. I noticed that this plugin uses the code from serverless-webpack. Any plans to add the ability to set your own path for the package.json? Or alternatively, climbing up the directories to look for a package.json file?

https://github.com/serverless-heaven/serverless-webpack/blob/31662103851933ac277b02119912b593c2914ece/lib/packExternalModules.js#L242 => https://github.com/floydspace/serverless-esbuild/blob/master/src/packExternalModules.ts#L151

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
floydspacecommented, Dec 11, 2020

@jayair @paulswail hey guys, I added an optional packagePath parameter which indicates the absolute path to the package.json file to be used for packaging, if it is omitted, the package.json will be found walking up folders. Please let me know if you have any issues. thanks

1reaction
paulswailcommented, Dec 8, 2020

I’m using a monorepo with a single root package.json and have hit the same issue. My preference would be for the default behaviour to be to climb up directories until it finds a package.json file like the serverless-webpack plugin does without requiring an explicit configuration setting.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to specify the path of `package.json` to npm?
I use npm scripts to build my project. I'd like to be able to run the scripts from a different directory. That is,...
Read more >
package.json - npm Docs
Dependencies are specified in a simple object that maps a package name to a version range. The version range is a string which...
Read more >
Specifying paths in package.json · Issue #1479 - GitHub
I know I can add a path for each file, but that's not what I want to do. There are lots of files,...
Read more >
Modules: Packages | Node.js v19.3.0 Documentation
In a package's package.json file, two fields can define entry points for a package: "main" and "exports" . Both fields apply to both...
Read more >
package.json - Tutorial - Vskills
The package.json file is normally located at the root directory of a Node.js project. Node itself is only aware of two fields in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found