Skip to content

Print the resolved require of webpack to the console

License

Notifications You must be signed in to change notification settings

eedrah/console-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

console-loader

npm GitHub issues GitHub license

Print the resolved request of webpack to the console. Short and simple.

Installation

Install via NPM

npm install console-loader --save-dev

or use directly

require('/path/to/dir/of/console-loader/index.js!/path/to/file.js')

Use and examples

var React = require('console!react')

will display the following in the console when webpack is run:

/path/to/dir/node_modules/console-loader/index.js!/path/to/dir/node_modules/react/react.js

Alternatively,

// es6
import foo from 'console!./foo.js'

or

// In webpack.config
module: {
    loaders: [{
        test: /\.css$/,
        loaders: ["style", "console", "css?sourceMap"]
    }]
}

which will display

/dir/node_modules/console-loader/index.js!/dir/node_modules/css-loader/index.js?sourceMap!/dir/my-file.js

Note that the query is displayed for all the loaders, and that the style loader is missing due to the loader order.

Contributions

Contributions are welcome! Feel free to log an issue or send a pull request if you would like to see options for

  • trimmed output
  • pretty output
  • the source that is passed through the loader
  • something else

Licence

Open Source - ISC - See LICENCE file

About

Print the resolved require of webpack to the console

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published