eslint.js文件配置
module.exports = {
root: true,
env: {
node: true,
jquery:true
},
‘extends’: [
‘plugin:vue/essential’,
‘@vue/standard’
],
rules: {
‘no-console’: process.env.NODE_ENV === ‘production’ ? ‘error’ : ‘off’,
‘no-debugger’: process.env.NODE_ENV === ‘production’ ? ‘error’ : ‘off’,
‘semi’: 0,//分号检查
‘quotes’: [0, ‘double’],
‘eol-last’: 0,
‘indent’: ‘off’,
‘no-unused-vars’: ‘off’
},
parserOptions: {
parser: ‘babel-eslint’
}
}
gitignore文件的配置
.DS_Store
node_modules
/dist
.env.local
.env.*.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.idea
.vscode
.git
*.suo
.ntvs
*.njsproj
*.sln
*.sw?
package.json管理依赖包的版本号,本次注重整合bootstrap3.3.7及jquery
{
“name”: “vue-marrylived”,
“version”: “0.1.0”,
“private”: true,
“scripts”: {
“serve”: “vue-cli-service serve”,
“build”: “vue-cli-service build”,
“lint”: “vue-cli-service lint”,
“report”: “vue-cli-service build --report”
},
“dependencies”: {
“axios”: “^0.19.0”,
“babel-runtime”: “^6.26.0”,
“core-js”: “^3.3.2”,
“jquery”: “^3.3.1”,
“bootstrap”: “^3.3.7”,
“vue”: “^2.6.10”,
“vue-router”: “^3.1.3”,
“vuex”: “^3.0.1”
},
“devDependencies”: {
“@vue/cli-plugin-babel”: “^4.0.0”,
“@vue/cli-plugin-eslint”: “^4.0.0”,
“@vue/cli-service”: “^4.0.0”,
“@vue/eslint-config-standard”: “^4.0.0”,
“babel-eslint”: “^10.0.3”,
“eslint”: “^5.16.0”,
“eslint-plugin-vue”: “^5.0.0”,
“stylus”: “^0.54.7”,
“stylus-loader”: “^3.0.2”,
“vue-template-compiler”: “^2.6.10”
}
}
新增vue.config.js文件因为3.0没有
/*
*Vue-CLI项目的核心配置文件
*/
const webpack = require(“webpack”);
module.exports = {
configureWebpack: {
plugins: [
new webpack.ProvidePlugin({
$: “jquery”,
jQuery: “jquery”,
“window.jQuery”: “jquery”,
Popper: [“popper.js”, “default”]
})
]
}
};
如果有需要main.js 文件内容
import Vue from ‘vue’
import App from ‘./App.vue’
import router from ‘./router’
import store from ‘./store’
// 导入bootstrap
import “bootstrap”
import “bootstrap/dist/css/bootstrap.css”
Vue.config.productionTip = false
new Vue({
router,
store,
render: h => h(App)
}).$mount(’#app’)