Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

asset-graph-webpack-plugin

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

asset-graph-webpack-plugin

Webpack plugin to easily get assets dependency graph based on entry point

  • 0.1.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

asset-graph-webpack-plugin

Webpack plugin to easily get assets dependency graph based on entry point

Given your application entry points, get all files needed to load from that entry point

No more manually write script tag every time you create another page!

Example

Your webpack.config.js file

var CommonsChunkPlugin = require('webpack/lib/optimize/CommonsChunkPlugin');
var AssetGraphPlugin = require('asset-graph-webpack-plugin');

module.exports = {
  target: 'web',
  entry: {
    home: './app/home',
    detail: './app/detail'
  },
  output: {
    filename: 'js/[name]-[hash].bundle.js',
    publicPath: '/assets/',
    chunkFilename: 'js/[name]-[chunkhash].bundle.js',
    path: './public/',
  },
  plugins: [
    new CommonsChunkPlugin({name: 'common'}),
    new AssetGraphPlugin('./assets.json')
  ]
};

Will output deps.json file which contain

{
  "hash": "3058a8bcbb6ee2dfe373",
  "publicPath": "/assets/",
  "assets": {
    "home": {
      "js": [
        "/assets/js/common-3058a8bcbb6ee2dfe373.bundle.js",
        "/assets/js/home-3058a8bcbb6ee2dfe373.bundle.js"
      ],
      "css": [
        "/assets/style-3058a8bcbb6ee2dfe373.css"
      ]
    },
    "detail": {
      "js": [
        "/assets/js/common-3058a8bcbb6ee2dfe373.bundle.js",
        "/assets/js/detail-3058a8bcbb6ee2dfe373.bundle.js"        
      ]
    },
  }
}

License

MIT

Keywords

FAQs

Package last updated on 05 Jan 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc