Skip to content
This repository has been archived by the owner on Jan 5, 2024. It is now read-only.

Commit

Permalink
Supports path aliases using @.
Browse files Browse the repository at this point in the history
  • Loading branch information
logue committed Dec 14, 2021
1 parent fd36601 commit b5a734f
Show file tree
Hide file tree
Showing 8 changed files with 257 additions and 211 deletions.
15 changes: 5 additions & 10 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,8 @@ parserOptions:
plugins:
- '@typescript-eslint'
- vuejs-accessibility
rules: {
require-jsdoc: off,
valid-jsdoc: off,
new-cap: off,
vue/html-self-closing: [error,
html: {
void: always
}
]
}
rules:
require-jsdoc: warn
valid-jsdoc: warn
new-cap: off
vue/html-self-closing: [error, html: { void: always }]
4 changes: 4 additions & 0 deletions .stylelintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@ plugins:
- stylelint-prettier
rules:
prettier/prettier: true
color-function-notation: legacy
selector-class-pattern: null
no-descending-specificity: null
at-rule-no-unknown: null
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@
},
"devDependencies": {
"@amatlash/vite-plugin-stylelint": "^1.2.0",
"@typescript-eslint/eslint-plugin": "^5.6.0",
"@typescript-eslint/parser": "^5.6.0",
"@vue/compiler-sfc": "^3.2.24",
"@types/node": "^16.11.12",
"@typescript-eslint/eslint-plugin": "^5.7.0",
"@typescript-eslint/parser": "^5.7.0",
"@vue/compiler-sfc": "^3.2.26",
"@vue/eslint-config-typescript": "^9.1.0",
"eslint": "^8.4.1",
"eslint-config-google": "^0.14.0",
Expand All @@ -56,8 +57,8 @@
"stylelint-config-recommended-vue": "^1.1.0",
"stylelint-config-standard": "^24.0.0",
"stylelint-prettier": "^2.0.0",
"typescript": "^4.5.3",
"vite": "^2.7.1",
"typescript": "^4.5.4",
"vite": "^2.7.2",
"vite-plugin-env-compatible": "^1.1.1",
"vite-plugin-eslint": "^1.3.0",
"vite-plugin-vue2": "^1.9.0",
Expand Down
7 changes: 6 additions & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,13 @@
import { Component, Vue } from 'vue-property-decorator';
@Component
/** App Component */
/**
* App Component
*/
export default class App extends Vue {
/**
* Before create
*/
beforeCreate() {
document.title = import.meta.env.VITE_APP_TITLE;
}
Expand Down
1 change: 1 addition & 0 deletions src/components/HelloWorld.vue
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ import { Component, Prop, Vue } from 'vue-property-decorator';
@Component
/** HelloWorld Component */
export default class HelloWorld extends Vue {
/** prop message */
@Prop() msg!: string;
}
</script>
Expand Down
9 changes: 7 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://json.schemastore.org/tsconfig.json",
"compilerOptions": {
"allowJs": true,
"allowJs": false,
"target": "esnext",
"useDefineForClassFields": true,
"experimentalDecorators": true,
Expand All @@ -15,7 +15,12 @@
"lib": [
"esnext",
"dom"
]
],
"paths": {
"@/*": [
"./src/*"
]
}
},
"include": [
"src/**/*.ts",
Expand Down
20 changes: 20 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,29 @@ import { createVuePlugin } from 'vite-plugin-vue2';
import eslintPlugin from 'vite-plugin-eslint';
import viteStylelint from '@amatlash/vite-plugin-stylelint';
import envCompatible from 'vite-plugin-env-compatible';
import path from 'path';

// https://vitejs.dev/config/
export default defineConfig({
resolve: {
alias: [
{
// vue @ shortcut fix
find: '@/',
replacement: `${path.resolve(__dirname, './src')}/`,
},
{
find: 'src/',
replacement: `${path.resolve(__dirname, './src')}/`,
},
],
},
server: {
fs: {
// Allow serving files from one level up to the project root
allow: ['..'],
},
},
plugins: [
// Vue2
createVuePlugin(),
Expand Down
Loading

0 comments on commit b5a734f

Please sign in to comment.