Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

package.json optimisation #28

Closed
maxpou opened this issue Sep 13, 2017 · 4 comments
Closed

package.json optimisation #28

maxpou opened this issue Sep 13, 2017 · 4 comments

Comments

@maxpou
Copy link
Contributor

maxpou commented Sep 13, 2017

Case

IS IT A: ENHANCEMENT

Issue

On npm install, I found several issues:

  • there is 2 warning

    npm WARN [email protected] No repository field.
    npm WARN [email protected] No license field.
    
  • some packages references tests but there is no tests in this project.
    Also chromedriver (for e2e tests) take a while to install.

Proposal:

  • update the package.json by adding the 2 missings fields.
  • remove unneeded devDependencies

Info

  • Operating System: OSX
  • Node-Version: 5.4.1

Reproduce

rm -rf node_modules
npm install
@pubkey
Copy link
Collaborator

pubkey commented Sep 13, 2017

It looks like the package.json has many more unused dependencies.

@maxpou
Copy link
Contributor Author

maxpou commented Sep 13, 2017

To get a good overview, I've done this: (based on the vue-cli + webpack template)

~/apps » vue init webpack package-json                                                                                                                                                                                           

? Project name package-json
? Project description A Vue.js project
? Author Maxence POUTORD <[email protected]>
? Vue build standalone
? Install vue-router? Yes
? Use ESLint to lint your code? Yes
? Pick an ESLint preset Standard
? Setup unit tests with Karma + Mocha? No
? Setup e2e tests with Nightwatch? No

It generates the following package.json:

  "devDependencies": {
    "autoprefixer": "^7.1.2",
    "babel-core": "^6.22.1",
    "babel-eslint": "^7.1.1",
    "babel-loader": "^7.1.1",
    "babel-plugin-transform-runtime": "^6.22.0",
    "babel-preset-env": "^1.3.2",
    "babel-preset-stage-2": "^6.22.0",
    "babel-register": "^6.22.0",
    "chalk": "^2.0.1",
    "connect-history-api-fallback": "^1.3.0",
    "copy-webpack-plugin": "^4.0.1",
    "css-loader": "^0.28.0",
    "cssnano": "^3.10.0",
    "eslint": "^3.19.0",
    "eslint-friendly-formatter": "^3.0.0",
    "eslint-loader": "^1.7.1",
    "eslint-plugin-html": "^3.0.0",
    "eslint-config-standard": "^6.2.1",
    "eslint-plugin-promise": "^3.4.0",
    "eslint-plugin-standard": "^2.0.1",
    "eventsource-polyfill": "^0.9.6",
    "express": "^4.14.1",
    "extract-text-webpack-plugin": "^2.0.0",
    "file-loader": "^0.11.1",
    "friendly-errors-webpack-plugin": "^1.1.3",
    "html-webpack-plugin": "^2.28.0",
    "http-proxy-middleware": "^0.17.3",
    "webpack-bundle-analyzer": "^2.2.1",
    "semver": "^5.3.0",
    "shelljs": "^0.7.6",
    "opn": "^5.1.0",
    "optimize-css-assets-webpack-plugin": "^2.0.0",
    "ora": "^1.2.0",
    "rimraf": "^2.6.0",
    "url-loader": "^0.5.8",
    "vue-loader": "^13.0.4",
    "vue-style-loader": "^3.0.1",
    "vue-template-compiler": "^2.4.2",
    "webpack": "^2.6.1",
    "webpack-dev-middleware": "^1.10.0",
    "webpack-hot-middleware": "^2.18.0",
    "webpack-merge": "^4.1.0"
  },

Then, a diff should do the work :)

@pubkey
Copy link
Collaborator

pubkey commented Sep 13, 2017

We still use some packages in the build-scripts that did not came with vue-init.

@cristijora
Copy link
Contributor

Guys you can easily look up here https://github.com/vuejs-templates/webpack/blob/develop/template/package.json#L79

And simply exclude the packages for e2e tests for example. They are between

{{#e2e}}
    "chromedriver": "^2.27.2",
    "cross-spawn": "^5.0.1",
    "nightwatch": "^0.9.12",
    "selenium-server": "^3.0.1",
{{/e2e}}

Same applies for unit test packages if you don't plan to write them

salomonelli added a commit that referenced this issue Sep 13, 2017
remove unneeded dependencies (#28)
maxpou added a commit to maxpou/best-resume-ever that referenced this issue Oct 17, 2017
pubkey added a commit that referenced this issue Oct 18, 2017
mattaschmann pushed a commit to mattaschmann/best-resume-ever that referenced this issue Mar 9, 2020
mattaschmann pushed a commit to mattaschmann/best-resume-ever that referenced this issue Mar 9, 2020
mattaschmann pushed a commit to mattaschmann/best-resume-ever that referenced this issue Mar 9, 2020
mattaschmann pushed a commit to mattaschmann/best-resume-ever that referenced this issue Mar 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants