Skip to content

Doesn't play well large package.json files #5

@mitopalov

Description

@mitopalov

A bug occurs on this line when package.json is large enough to have more then one chunk. This code assumes the whole file will fit in one chunk, and as a result it breaks

First chunk ends up like this

{
  "name": "prebid.js",
  "version": "7.10.0",
  "description": "Header Bidding Management Library",
  "main": "src/prebid.js",
  "scripts": {
    "test": "gulp test",
    "lint": "gulp lint"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/prebid/Prebid.js.git"
  },
  "sideEffects": [
    "src/prebid.js",
    "modules/*.js",
    "modules/*/index.js"
  ],
  "browserslist": [
    "> 0.25%",
    "not IE 11",
    "not op_mini all"
  ],
  "keywords": [
    "advertising",
    "auction",
    "header bidding",
    "prebid"
  ],
  "globalVarName": "pbjs",
  "author": "the prebid.js contributors",
  "license": "Apache-2.0",
  "engines": {
    "node": ">=8.9.0"
  },
  "devDependencies": {
    "@babel/eslint-parser": "^7.16.5",
    "@jsdevtools/coverage-istanbul-loader": "^3.0.3",
    "@wdio/browserstack-service": "^7.16.0",
    "@wdio/cli": "^7.5.2",
    "@wdio/concise-reporter": "^7.5.2",
    "@wdio/local-runner": "^7.5.2",
    "@wdio/mocha-framework": "^7.5.2",
    "@wdio/spec-reporter": "^7.19.0",
    "@wdio/sync": "^7.5.2",
    "ajv": "6.12.3",
    "assert": "^2.0.0",
    "babel-loader": "^8.0.5",
    "babel-register": "^6.26.0",
    "body-parser": "^1.19.0",
    "chai": "^4.2.0",
    "coveralls": "^3.1.0",
    "deep-equal": "^2.0.3",
    "documentation": "^13.2.5",
    "es5-shim": "^4.5.14",
    "eslint": "^7.27.0",
    "eslint-config-standard": "^10.2.1",
    "eslint-plugin-import": "^2.20.2",
    "eslint-plugin-node": "^11.1.0",
    "eslint-plugin-prebid": "file:./plugins/eslint",
    "eslint-plugin-promise": "^5.1.0",
    "eslint-plugin-standard": "^3.0.1",
    "execa": "^1.0.0",
    "faker": "^5.5.3",
    "fs.extra": "^1.3.2",
    "gulp": "^4.0.0",
    "gulp-clean": "^0.3.2",
    "gulp-concat": "^2.6.0",
    "gulp-connect": "^5.7.0",
    "gulp-eslint": "^4.0.0",
    "gulp-if": "^3.0.0",
    "gulp-js-escape": "^1.0.1",
    "gulp-replace": "^1.0.0",
    "gulp-shell": "^0.8.0",
    "gulp-sourcemaps": "^3.0.0",
    "gulp-terser": "^2.0.1",
    "gulp-util": "^3.0.0",
    "is-docker": "^2.2.1",
    "istanbul": "^0.4.5",
    "karma": "^6.3.2",
    "karma-babel-preprocessor": "^8.0.1",
    "karma-browserstack-launcher": "1.4.0",
    "karma-chai": "^0.1.0",
    "karma-chrome-launcher": "^3.1.0",
    "karma-coverage": "^2.0.1",
    "karma-coverage-istanbul-reporter": "^3.0.3",
    "karma-es5-shim": "^0.0.4",
    "karma-firefox-launcher": "^2.1.0",
    "karma-ie-launcher": "^1.0.0",
    "karma-mocha": "^2.0.1",
    "karma-mocha-reporter": "^2.2.5",
    "karma-opera-launcher": "^1.0.0",
    "karma-safari-launcher": "^1.0.0",
    "karma-script-launcher": "^1.0.0",
    "karma-sinon": "^1.0.5",
    "karma-sourcemap-loader": "^0.3.7",
    "karma-spec-reporter": "^0.0.32",
    "karma-webpack": "^5.0.0",
    "lodash": "^4.17.21",
    "mocha": "^5.0.0",
    "morgan": "^1.10.0",
    "opn": "^5.4.0",
    "resolve-from": "^5.0.0",
    "sinon": "^4.1.3",
    "through2": "^4.0.2",
    "url": "^0.11.0",
    "url-parse": "^1.0.5",
    "webdriverio": "^7.6.1",
    "webpack": "^5.70.0",
    "webpack-bundle-analyzer": "^4

Then a second one comes

.5.0",
    "webpack-manifest-plugin": "^5.0.0",
    "webpack-stream": "^7.0.0",
    "yargs": "^1.3.1"
  },
  "dependencies": {
    "@babel/core": "^7.16.7",
    "@babel/preset-env": "^7.16.8",
    "@babel/runtime": "^7.18.9",
    "@babel/plugin-transform-runtime": "^7.18.9",
    "core-js": "^3.13.0",
    "core-js-pure": "^3.13.0",
    "criteo-direct-rsa-validate": "^1.1.0",
    "crypto-js": "^3.3.0",
    "dlv": "1.1.3",
    "dset": "2.0.1",
    "express": "^4.15.4",
    "fun-hooks": "^0.9.9",
    "just-clone": "^1.0.2",
    "live-connect-js": "2.3.3"
  },
  "optionalDependencies": {
    "fsevents": "^2.3.2"
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions