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.

bower.json takes precedence over package.json when using DirectoryDescriptionFilePlugin

See original GitHub issue

Some of my modules installed from npm also define a bower.json file. When using the following plugin, the main field from their bower.json will be used to resolve them, when I’d expect webpack to use package.json.

new webpack.ResolverPlugin(
  new webpack.ResolverPlugin.DirectoryDescriptionFilePlugin('bower.json', ['main'])
)

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
lukescottcommented, Apr 15, 2016

I tried what @fenivana suggests, but it isn’t working for me. It is now using package.json in bower_components. What I actually need is:

bower_components -> use bower.json only node_modules -> use package.json only

1reaction
juplcommented, Aug 22, 2015

@fenivana Nice. I would add for the browser property as there are some NPM packages that use main for server-side and browser for client-side.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How Yarn manages package.json and bower.json files, when ...
In my project's root folder,both bower.json and package.json are present. When using npm previosly,i do both npm and bower install seperately.
Read more >
Project Config with vercel.json
The framework property can be used to override the Framework Preset in the Project Settings dashboard. The value must be a valid framework...
Read more >
How to use webpack with Rails - clarkdave.net
Installing webpack & Bower. Installing webpack. Because webpack is a node.js application, we'll need a package.json file in our Rails root.
Read more >
bower | Yarn - Package Manager
Bower - A package manager for the web. Build Backers on Open Collective Sponsors on Open Collective ..psst! While Bower is maintained, we...
Read more >
bower.json and .bowerrc missing from VS templates...
When the process was ok, it creates a file with json inside and also ... or where's a guide on how to install...
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