Socket
Socket
Sign inDemoInstall

@constgen/neutrino-analysis

Package Overview
Dependencies
392
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0 to 1.5.0

31

index.js
let { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer')
let deepmerge = require('deepmerge')
let dependency = require('@constgen/neutrino-dependency')
let deepmerge = require('deepmerge')
let dependency = require('@constgen/neutrino-dependency')
module.exports = function (customSettings = {}) {
return function (neutrino) {
let prodMode = neutrino.config.get('mode') !== 'development'
let productionMode = neutrino.config.get('mode') !== 'development'
let defaultSettings = {
circularDependency: true,
dependencies : true,
bundleAnalyzer: true
}
let settings = deepmerge(defaultSettings, customSettings)
let port = Number(neutrino.config.devServer.get('port'))
let settings = deepmerge(defaultSettings, customSettings)
let port = Number(neutrino.config.devServer.get('port'))
neutrino.config
.when(settings.circularDependency, function () {
.when(settings.dependencies, function () {
neutrino.use(dependency())

@@ -21,11 +21,12 @@ })

config.plugin('bundle-analyzer').use(BundleAnalyzerPlugin, [{
analyzerMode: prodMode ? 'static' : 'server',
analyzerHost: 'localhost',
analyzerPort: port ? (port + 1) : 'auto',
reportFilename: 'bundle-report.html',
defaultSizes: 'parsed',
openAnalyzer: false,
analyzerMode : productionMode ? 'static' : 'server',
analyzerHost : 'localhost',
analyzerPort : port ? (port + 1) : 'auto',
reportFilename : 'bundle-report.html',
defaultSizes : 'parsed',
openAnalyzer : false,
generateStatsFile: false,
statsFilename: 'stats.json',
statsOptions: null,
statsFilename : 'bundle-stats.json',
// statsOptions : { }, // https://webpack.js.org/configuration/stats/
excludeAssets (assetName) {

@@ -32,0 +33,0 @@ const HMR_PATCH_EXP = /hot-update\.js$/

{
"name": "@constgen/neutrino-analysis",
"version": "1.0.0",
"version": "1.5.0",
"description": "Neutrino middleware that adds bundle analysis tools",

@@ -24,3 +24,3 @@ "main": "index.js",

"dependencies": {
"@constgen/neutrino-dependency": "1.0.0",
"@constgen/neutrino-dependency": "1.5.0",
"deepmerge": "4.2.2",

@@ -30,6 +30,7 @@ "webpack-bundle-analyzer": "3.6.1"

"peerDependencies": {
"neutrino": "^9.0.0"
"neutrino": "^9.0.0",
"webpack": "^4.0.0"
},
"files": [
"*.js",
"**/*.js",
"README.md",

@@ -36,0 +37,0 @@ "package.json"

@@ -12,2 +12,3 @@ # @constgen/neutrino-analysis

- Neutrino v9
- Webpack v4

@@ -32,3 +33,3 @@ ## Installation

neutrino.use(analysis({
circularDependency: true, // report in the terminal about circular dependncies
dependencies : true, // report in the terminal about circular or duplicated dependncies
bundleAnalyzer: true // enable BundleAnalyzerPlugin

@@ -35,0 +36,0 @@ }))

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc