diff --git a/.browserslistrc b/.browserslistrc new file mode 100644 index 0000000..214388f --- /dev/null +++ b/.browserslistrc @@ -0,0 +1,3 @@ +> 1% +last 2 versions +not dead diff --git a/.eslintignore b/.eslintignore index 95cf0b0..178135c 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,3 +1 @@ -/build/ -/config/ -/dist/ \ No newline at end of file +/dist/ diff --git a/.eslintrc.js b/.eslintrc.js index 7c23921..50c0639 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,33 +1,34 @@ +const prod = process.env.NODE_ENV === 'production' + module.exports = { root: true, + env: { + node: true + }, + extends: [ + 'plugin:vue/strongly-recommended', + 'plugin:vue-a11y/base', + 'eslint:recommended', + '@vue/standard' + ], + plugins: [ + 'vue-a11y' + ], parserOptions: { parser: 'babel-eslint' }, - env: { - browser: true, - node: true, - mocha: true - }, - "globals": { - "expect": true - }, - extends: [ - 'plugin:vue/recommended', - 'plugin:vue-a11y/base', - 'standard' - ], - plugins: [ - 'vue', - 'vue-a11y' - ], rules: { - 'generator-star-spacing': 'off', - 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', - 'vue/singleline-html-element-content-newline': 'off', - 'vue/multiline-html-element-content-newline': 'off', - 'vue/max-attributes-per-line': 'off', - 'vue/no-v-html': 'off', - 'vue/require-default-prop': 'off', - 'vue-a11y/label-has-for': 'off' + 'no-console': prod ? 'warn' : 'off', + 'no-debugger': prod ? 'warn' : 'off', + 'vue/max-attributes-per-line': [ + 'error', + { + singleline: 3, + multiline: { max: 3, allowFirstLine: true } + } + ], + 'no-irregular-whitespace': 'off', + 'no-unused-vars': 'warn', + 'no-multiple-empty-lines': ['error', { max: 2 }] } } diff --git a/babel.config.js b/babel.config.js new file mode 100644 index 0000000..e955840 --- /dev/null +++ b/babel.config.js @@ -0,0 +1,5 @@ +module.exports = { + presets: [ + '@vue/cli-plugin-babel/preset' + ] +} diff --git a/package.json b/package.json index 9f1769d..86c9332 100644 --- a/package.json +++ b/package.json @@ -1,77 +1,42 @@ { - "name": "vue-webpack-4", - "version": "1.1.0", - "description": "A Vuejs template using Webpack 4", - "main": "index.js", + "name": "en-francais", + "version": "0.1.0", + "license": "GPL-3.0", + "private": true, + "author": "Nicolas CHESNAIS", "scripts": { - "dev": "webpack-dev-server --progress --config build/webpack.config.dev.js", - "prod": "webpack --config build/webpack.config.prod.js", - "lint": "eslint --ext .js,.vue src", - "lint:fix": "eslint --ext .js,.vue src --fix", - "test": "jest --config test/jest.config.js", - "test:debug": "node --inspect node_modules/.bin/jest --runInBand --config test/jest.config.js" + "dev": "vue-cli-service serve", + "prod": "vue-cli-service build", + "lint": "vue-cli-service lint --no-fix", + "lint:fix": "vue-cli-service lint" }, - "keywords": [ - "Vue", - "Webpack 4" - ], - "author": "Daniel Cook", - "license": "MIT", "dependencies": { - "@popperjs/core": "^2.4.4", - "axios": "^0.18.1", - "vue": "^2.6.10", - "vue-clipboard2": "^0.3.1", - "vue-infinite-loading": "^2.4.5", - "vue-meta": "^1.6.0", - "vue-router": "^3.1.3", - "vue-scrollto": "^2.18.1", - "vue-select": "^3.10.7", - "vue2-touch-events": "^2.2.1", - "vuex": "^3.1.1", - "vuex-router-sync": "^5.0.0" + "axios": "^0.21.1", + "core-js": "^3.6.5", + "vue": "^2.6.11", + "vue-meta": "^2.4.0", + "vue-router": "^3.2.0", + "vue2-touch-events": "^3.2.0", + "vuex": "^3.4.0" }, "devDependencies": { - "@babel/core": "^7.6.0", - "@babel/preset-env": "^7.6.0", - "@vue/test-utils": "^1.0.0-beta.29", - "babel-core": "^7.0.0-bridge.0", - "babel-eslint": "^10.0.3", - "babel-jest": "^24.9.0", - "babel-loader": "^8.0.6", - "copy-webpack-plugin": "^5.0.4", - "css-loader": "^2.1.1", - "eslint": "^5.16.0", - "eslint-config-standard": "^12.0.0", - "eslint-loader": "^2.2.1", - "eslint-plugin-import": "^2.18.2", - "eslint-plugin-node": "^8.0.1", + "@vue/cli-plugin-babel": "~4.5.0", + "@vue/cli-plugin-eslint": "~4.5.0", + "@vue/cli-plugin-router": "~4.5.0", + "@vue/cli-plugin-vuex": "~4.5.0", + "@vue/cli-service": "~4.5.0", + "@vue/eslint-config-standard": "^5.1.2", + "babel-eslint": "^10.1.0", + "eslint": "^6.7.2", + "eslint-config-standard": "^16.0.2", + "eslint-plugin-import": "^2.20.2", + "eslint-plugin-node": "^11.1.0", "eslint-plugin-promise": "^4.2.1", - "eslint-plugin-standard": "^4.0.1", - "eslint-plugin-vue": "^5.2.3", - "eslint-plugin-vue-a11y": "0.0.28", - "file-loader": "^4.2.0", - "html-webpack-harddisk-plugin": "^1.0.1", - "html-webpack-plugin": "^3.2.0", - "jest": "^24.9.0", - "jest-serializer-vue": "^2.0.2", - "mini-css-extract-plugin": "^0.5.0", + "eslint-plugin-standard": "^4.0.0", + "eslint-plugin-vue": "^6.2.2", + "eslint-plugin-vue-a11y": "0.0.31", "node-sass": "^4.12.0", - "sass-loader": "^7.3.1", - "style-loader": "^0.23.1", - "stylus": "^0.54.7", - "stylus-loader": "^3.0.2", - "uglify-es": "^3.3.9", - "uglifyjs-webpack-plugin": "^2.2.0", - "url-loader": "^1.1.2", - "vue-jest": "^3.0.5", - "vue-loader": "^15.7.1", - "vue-server-renderer": "^2.6.10", - "vue-style-loader": "^4.1.2", - "vue-template-compiler": "^2.6.10", - "webpack": "^4.40.2", - "webpack-cli": "^3.3.9", - "webpack-dev-server": "^3.8.1", - "webpack-merge": "^4.2.2" + "sass-loader": "^8.0.2", + "vue-template-compiler": "^2.6.11" } } diff --git a/public/index.html b/public/index.html index 8200e8f..df52a80 100644 --- a/public/index.html +++ b/public/index.html @@ -1,11 +1,16 @@ - + + + En Françai(s) - + +
diff --git a/src/App.vue b/src/App.vue index 5d26266..006b4dd 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,31 +1,25 @@ diff --git a/src/main.js b/src/main.js index d655907..e9bcad5 100644 --- a/src/main.js +++ b/src/main.js @@ -1,23 +1,15 @@ import Vue from 'vue' -import router from './router' -import store from './store' -// import { sync } from 'vuex-router-sync' import Meta from 'vue-meta' import Vue2TouchEvents from 'vue2-touch-events' +import router from './router' +import store from './store' import App from './App' -import 'assets/css/mdi/css/materialdesignicons.css' -// import 'mdi/font' -import 'vue-select/src/scss/vue-select.scss' -import 'assets/css/app.scss' Vue.use(Meta) Vue.use(Vue2TouchEvents) -// Define the api path regarding the environment -// https://apple.stackexchange.com/questions/17077/add-a-hosts-file-entry-without-jailbreaking -// window.apipath = process.env === 'prod' || window.location.hostname === 'dev.gdp.fr' ? `http://${window.location.hostname}/api` : 'http://localhost:8984' new Vue({ router, diff --git a/src/pages/Home.vue b/src/pages/Home.vue index 799239a..8f99447 100644 --- a/src/pages/Home.vue +++ b/src/pages/Home.vue @@ -1,19 +1,11 @@ diff --git a/src/pages/NotFound.vue b/src/pages/NotFound.vue index f074e16..8972f40 100644 --- a/src/pages/NotFound.vue +++ b/src/pages/NotFound.vue @@ -33,7 +33,7 @@ export default { }, metaInfo () { return { - title: `Not Found` + title: 'Not Found' } } } diff --git a/src/router/index.js b/src/router/index.js index f28d9b0..d28e02b 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -1,10 +1,8 @@ import Vue from 'vue' -import Router from 'vue-router' +import VueRouter from 'vue-router' +import Home from '../pages/Home.vue' -import Home from 'pages/Home' -import NotFound from 'pages/NotFound' - -Vue.use(Router) +Vue.use(VueRouter) const routes = [ { @@ -16,11 +14,14 @@ const routes = [ name: 'notfound', path: '/404', alias: '*', - component: NotFound + component: () => import(/* webpackChunkName: "404" */ '../pages/NotFound.vue') } ] -export default new Router({ +const router = new VueRouter({ mode: 'history', + base: process.env.BASE_URL, routes }) + +export default router diff --git a/vue.config.js b/vue.config.js new file mode 100644 index 0000000..8629077 --- /dev/null +++ b/vue.config.js @@ -0,0 +1,22 @@ +module.exports = { + publicPath: '/', + devServer: { + clientLogLevel: 'warning', + // historyApiFallback: { + // index: '/', + // disableDotRule: true, + // verbose: true + // }, + // hot: true, + // contentBase: 'dist', + // compress: true, + host: '0.0.0.0', + port: 8988, + disableHostCheck: true, + publicPath: '/', + // quiet: false, + watchOptions: { + ignored: /node_modules/ + } + } +}