Skip to content

Change how dependencies are organized by default #32

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

Closed
pyritewolf opened this issue Nov 5, 2020 · 0 comments
Closed

Change how dependencies are organized by default #32

pyritewolf opened this issue Nov 5, 2020 · 0 comments

Comments

@pyritewolf
Copy link

Hey guys! I'm new to the community, so what I'm saying might be nonesense 😅 but running this template generated the following package.json for me:

{
  "name": "svelte-app",
  "version": "1.0.0",
  "devDependencies": {
    "cross-env": "^5.2.0",
    "css-loader": "^2.1.1",
    "mini-css-extract-plugin": "^0.6.0",
    "serve": "^11.0.0",
    "style-loader": "^0.23.1",
    "svelte": "^3.0.0",
    "svelte-loader": "2.13.3",
    "webpack": "^4.30.0",
    "webpack-cli": "^3.3.0",
    "webpack-dev-server": "^3.3.1"
  },
  "scripts": {
    "build": "cross-env NODE_ENV=production webpack",
    "dev": "webpack-dev-server --content-base public"
  }
}

Which was all nice and well until I tried to make a prod build (npm install --production && npm run build) and I realized all the dependencies are configured as devDependencies, even some that shouldn't be. After some trial and error, these are the minimum packages that I had to move to dependencies for things to work properly on my prod build:

{
  "name": "svelte-app",
  "version": "1.0.0",
  "dependencies": {
    "cross-env": "^5.2.0",
    "css-loader": "^2.1.1",
    "mini-css-extract-plugin": "^0.6.0",
    "svelte": "^3.0.0",
    "svelte-loader": "2.13.3",
    "webpack": "^4.30.0",
    "webpack-cli": "^3.3.0"
  },
  "devDependencies": {
    "serve": "^11.0.0",
    "style-loader": "^0.23.1",
    "webpack-dev-server": "^3.3.1"
  },
  "scripts": {
    "build": "cross-env NODE_ENV=production webpack",
    "dev": "webpack-dev-server --content-base public"
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants