Skip to content

Commit

Permalink
chore: replace vue-cli with vite
Browse files Browse the repository at this point in the history
  • Loading branch information
Kholid060 committed Apr 26, 2021
1 parent 736660d commit e674cd1
Show file tree
Hide file tree
Showing 10 changed files with 1,384 additions and 8,478 deletions.
10 changes: 2 additions & 8 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
module.exports = {
root: true,
env: {
browser: true,
node: true,
},
extends: [
'plugin:vue/essential',
'@vue/airbnb',
],
parserOptions: {
parser: 'babel-eslint',
},
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
},
extends: ['plugin:vue/vue3-recommended', 'plugin:prettier-vue/recommended'],
};
4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"semi": true,
"singleQuote": true
}
6 changes: 1 addition & 5 deletions public/index.html → index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<meta name="google-site-verification" content="fXdVxE2E3p8p3lQv6erGx_M0Gy83aaG9fTvaS4UgE3A" />
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
Expand All @@ -22,10 +21,7 @@
<meta property="twitter:image" content="/image.png">
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
<script type="module" src="/src/main.js"></script>
</body>
</html>
64 changes: 24 additions & 40 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
{
"name": "mkdown",
"version": "0.1.0",
"private": true,
"license": "MIT",
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint",
"now-build": "npm run build",
"deploy": "now"
"dev": "vite",
"build": "vite build",
"lint": "eslint --ext .js,.vue --ignore-path .gitignore .",
"commit": "cz"
},
"dependencies": {
"@mdi/js": "^5.7.55",
"codemirror": "^5.52.2",
"core-js": "^3.6.4",
"file-saver": "^2.0.2",
"highlight.js": "^10.1.1",
"lodash.camelcase": "^4.3.0",
"lodash.debounce": "^4.0.8",
"markdown-it": "^12.0.0",
"markdown-it-abbr": "^1.0.4",
"markdown-it-deflist": "^2.0.3",
Expand All @@ -28,46 +24,34 @@
"markdown-it-task-lists": "^2.1.1",
"register-service-worker": "^1.6.2",
"shortid": "^2.2.15",
"simplebar": "^5.3.0",
"simplebar-vue": "^1.4.0",
"turndown": "^6.0.0",
"turndown-plugin-gfm": "^1.0.2",
"v-tooltip": "^2.0.3",
"vue": "^2.6.11",
"vue-codemirror": "^4.0.6",
"vue-mdijs": "^0.4.13",
"vue-router": "^3.1.5",
"vue-toastification": "^1.4.0",
"vuex": "^3.1.2"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.4.4",
"@vue/cli-plugin-eslint": "~4.5.7",
"@vue/cli-plugin-pwa": "~4.5.7",
"@vue/cli-plugin-router": "~4.5.12",
"@vue/cli-plugin-vuex": "~4.2.0",
"@vue/cli-service": "~4.5.7",
"@vue/eslint-config-airbnb": "^5.0.2",
"babel-eslint": "^10.0.3",
"eslint": "^6.7.2",
"eslint-plugin-import": "^2.20.1",
"eslint-plugin-vue": "^7.8.0",
"lint-staged": "^9.5.0",
"node-sass": "^4.12.0",
"raw-loader": "^4.0.0",
"sass-loader": "^8.0.2",
"style-loader": "^1.1.3",
"to-string-loader": "^1.1.6",
"vue-cli-plugin-tailwind": "~1.2.0",
"vue-template-compiler": "^2.6.11"
"@rollup/plugin-eslint": "^8.0.1",
"@tailwindcss/forms": "^0.2.1",
"@vitejs/plugin-vue": "^1.0.4",
"@vue/compiler-sfc": "^3.0.5",
"autoprefixer": "^10.2.4",
"babel-eslint": "^10.1.0",
"cz-conventional-changelog": "3.3.0",
"eslint-config-prettier": "^8.0.0",
"eslint-plugin-prettier-vue": "^3.0.0-alpha.2",
"eslint-plugin-vue": "^7.6.0",
"postcss": "^8.2.6",
"prettier": "^2.2.1",
"rollup-plugin-analyzer": "^4.0.0",
"tailwindcss": "^2.1.1",
"vite": "^2.0.0-beta.12"
},
"gitHooks": {
"pre-commit": "lint-staged"
},
"lint-staged": {
"*.{js,jsx,vue}": [
"vue-cli-service lint",
"git add"
]
"config": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
}
}
6 changes: 1 addition & 5 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
module.exports = {
plugins: {
tailwindcss: {},
'vue-cli-plugin-tailwind/purgecss': {
whitelist: ['tooltip-ui'],
whitelistPatterns: [/CodeMirror/, /simplebar/, /hljs/, /markdown-content/, /(cm-s-ayu-mirage|cm)/, /vue-popover-theme/],
whitelistPatternsChildren: [/(table|img|tr|td|tbody|thead)/],
},
autoprefixer: {},
},
};
32 changes: 0 additions & 32 deletions src/registerServiceWorker.js

This file was deleted.

1 change: 1 addition & 0 deletions tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
module.exports = {
mode: 'jit',
theme: {
borderRadius: {
sm: '0.125rem',
Expand Down
24 changes: 24 additions & 0 deletions vite.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import vue from '@vitejs/plugin-vue';
import eslint from '@rollup/plugin-eslint';
import path from 'path';
import analyze from 'rollup-plugin-analyzer';

/**
* @type {import('vite').UserConfig}
*/
export default {
plugins: [
vue(),
{
...eslint({
include: ['./src/**/*.vue', './src/**/*.js'],
}),
enforce: 'pre',
},
],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
};
15 changes: 0 additions & 15 deletions vue.config.js

This file was deleted.

Loading

0 comments on commit e674cd1

Please sign in to comment.