mirror of
https://github.com/nextcloud/spreed.git
synced 2025-12-17 21:12:20 +01:00
build: provide Typescript support in Vue SFC files
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
This commit is contained in:
parent
89e20d99c8
commit
ec9e5d9ec5
4 changed files with 28 additions and 2 deletions
|
|
@ -1,6 +1,7 @@
|
|||
module.exports = {
|
||||
extends: [
|
||||
'@nextcloud',
|
||||
'@nextcloud/eslint-config/typescript',
|
||||
],
|
||||
globals: {
|
||||
// @nextcloud/webpack-vue-config globals
|
||||
|
|
@ -12,6 +13,7 @@ module.exports = {
|
|||
rules: {
|
||||
'comma-dangle': 'off',
|
||||
'jsdoc/no-defaults': 'off',
|
||||
'@typescript-eslint/no-unused-vars': 'off',
|
||||
'import/newline-after-import': 'warn',
|
||||
'import/no-named-as-default-member': 'off',
|
||||
'import/order': [
|
||||
|
|
|
|||
|
|
@ -86,6 +86,12 @@ module.exports = {
|
|||
},
|
||||
|
||||
transform: {
|
||||
'\\.ts$': ['ts-jest', {
|
||||
useESM: true,
|
||||
tsconfig: {
|
||||
verbatimModuleSyntax: false,
|
||||
},
|
||||
}],
|
||||
'\\.js$': 'babel-jest',
|
||||
'\\.vue$': '@vue/vue2-jest',
|
||||
'\\.tflite$': 'jest-transform-stub',
|
||||
|
|
|
|||
|
|
@ -1,14 +1,20 @@
|
|||
{
|
||||
"include": ["./src/**/*.ts"],
|
||||
"include": ["./src/**/*.ts", "./src/**/*.vue"],
|
||||
"exclude": ["node_modules", "vendor"],
|
||||
"compilerOptions": {
|
||||
"outDir": "./js",
|
||||
"allowJs": true,
|
||||
"module": "CommonJS",
|
||||
"checkJs": true,
|
||||
"allowImportingTsExtensions": true,
|
||||
"lib": ["ESNext"],
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "bundler",
|
||||
"verbatimModuleSyntax": true,
|
||||
"target": "ES2020",
|
||||
"esModuleInterop": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
},
|
||||
"vueCompilerOptions": {
|
||||
"target": 2.7,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ module.exports = mergeWithRules({
|
|||
test: 'match',
|
||||
loader: 'replace',
|
||||
options: 'replace',
|
||||
use: 'replace',
|
||||
},
|
||||
},
|
||||
})({
|
||||
|
|
@ -62,6 +63,17 @@ module.exports = mergeWithRules({
|
|||
'webdav',
|
||||
]),
|
||||
},
|
||||
{
|
||||
test: /\.tsx?$/,
|
||||
use: [{
|
||||
loader: 'esbuild-loader',
|
||||
options: {
|
||||
// Implicitly set as TS loader so only <script lang="ts"> Vue SFCs will be transpiled
|
||||
loader: 'ts',
|
||||
target: 'es2020',
|
||||
},
|
||||
}]
|
||||
},
|
||||
{
|
||||
test: /\.wasm$/i,
|
||||
type: 'asset/resource',
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue