Commit 06a95d15 authored by shenzhiqiang's avatar shenzhiqiang

fix: 报错修复

parent 55abcfa1
...@@ -10,9 +10,7 @@ declare module 'vue/types/options' { ...@@ -10,9 +10,7 @@ declare module 'vue/types/options' {
} }
declare module 'vue/types/vue' { declare module 'vue/types/vue' {
interface Vue extends GlobalMixins { interface Vue extends GlobalMixins {
$u: $u, $u: $u;
$scss: any $scss: any;
} }
} }
declare var ROUTES=[]
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
] ]
}, },
"include": [ "include": [
"src/**/*.ts", "**/*.ts",
"src/**/*.tsx", "src/**/*.tsx",
"src/**/*.vue", "src/**/*.vue",
"tests/**/*.ts", "tests/**/*.ts",
......
// vue.config.js
const TransformPages = require('uni-read-pages')
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin')
const { webpack } = new TransformPages()
module.exports = {
configureWebpack: (config) => {
config.plugins = [
new webpack.DefinePlugin({
ROUTES: webpack.DefinePlugin.runtimeValue(() => {
const tfPages = new TransformPages({
includes: ['path', 'name', 'aliasPath']
})
return JSON.stringify(tfPages.routes)
}, true)
})
]
// 限制工作线程使用1024MB内存
// get a reference to the existing ForkTsCheckerWebpackPlugin
const existingForkTsChecker = config.plugins.filter(
p => p instanceof ForkTsCheckerWebpackPlugin
)[0]
// remove the existing ForkTsCheckerWebpackPlugin
// so that we can replace it with our modified version
config.plugins = config.plugins.filter(
p => !(p instanceof ForkTsCheckerWebpackPlugin)
)
// copy the options from the original ForkTsCheckerWebpackPlugin
// instance and add the memoryLimit property
const forkTsCheckerOptions = existingForkTsChecker.options
forkTsCheckerOptions.memoryLimit = 1024
config.plugins.push(new ForkTsCheckerWebpackPlugin(forkTsCheckerOptions))
},
transpileDependencies: ['uview-ui']
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment