共享node_modules时如何为Vue项目提供服务?

时间:2019-02-07 09:00:43

标签: vue.js npm

由于我有多个Vue项目,所以我决定共享node_modules和package.json文件。我有这样的文件夹结构:

-- Admin
---- src
---- index.html
---- App.vue
-- User
---- src
---- index.html
---- App.vue
-- node_modules
-- package.json
-- package-lock.json

那么,我想启动“ Admin”和“ User”项目,该怎么办?

package.json文件:

{
  "name": "Soft",
  "description": "A Vue.js project",
  "version": "1.0.0",
  "author": "Mehmet",
  "license": "MIT",
  "private": true,
  "scripts": {
    "dev": "cross-env NODE_ENV=development webpack-dev-server --open --hot",
    "build": "cross-env NODE_ENV=production webpack --progress --hide-modules"
  },
  "dependencies": {
    "vue": "^2.5.11"
  },
  "browserslist": [
    "> 1%",
    "last 2 versions",
    "not ie <= 8"
  ],
  "devDependencies": {
    "babel-core": "^6.26.0",
    "babel-loader": "^7.1.2",
    "babel-preset-env": "^1.6.0",
    "babel-preset-stage-3": "^6.24.1",
    "cross-env": "^5.0.5",
    "css-loader": "^0.28.7",
    "file-loader": "^1.1.4",
    "node-sass": "^4.5.3",
    "sass-loader": "^6.0.6",
    "vue-loader": "^13.0.5",
    "vue-template-compiler": "^2.4.4",
    "webpack": "^3.6.0",
    "webpack-dev-server": "^2.9.1"
  }
}

0 个答案:

没有答案