Define deps & loaders in package.json
See original GitHub issueAs 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:
- Created 8 years ago
- Comments:17 (11 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Let’s move this on
webpack@5
with low priorityThis 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.