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.

Define deps & loaders in package.json

See original GitHub issue

As a package developer it’d be freaking awesome to define deps in the package.json, so that a require("foo") loads it’s main as well as any additional stuff it may need.

{
  name: "foo",
  main: "src/foo.js", // for non-webpackers
  webpack: ["src/foo.js", "src/css/styles.css", "src/html/template.html"],
}

But a lot of the time the deps require a loader…

{ name: “foo”, main: “src/foo.js”, webpack: [“6to5!src/foo.js”, “styl!css!src/css/styles.styl”, “handlebars!src/html/template.hbs”], }

Is there any way of making that work?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:17 (11 by maintainers)

github_iconTop GitHub Comments

3reactions
alexander-akaitcommented, Apr 19, 2018

Let’s move this on webpack@5 with low priority

1reaction
webpack-botcommented, Oct 15, 2019

This issue had no activity for at least three months.

It’s subject to automatic issue closing if there is no activity in the next 15 days.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Loaders - webpack
Loaders are transformations that are applied to the source code of a module. They allow you to pre-process files as you import or...
Read more >
Throws if either `dependencies` or `devDependencies` is not ...
A project need not define dependencies nor devDependencies for this loader to work. In my specific use case, the project in question is...
Read more >
A Guide to Managing Webpack Dependencies - Toptal
The Webpack module bundler processes JavaScript code and all static assets, such as stylesheets, images, and fonts. However, configuring Webpack and its ...
Read more >
package.json - npm Docs
json which is a map of command name to local file name. When this package is installed globally, that file will be either...
Read more >
Need validation of my understanding of dev-dependencies ...
dependencies : only the packages which are finally going to be used by the production build. These will be there in the final...
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