Open xgqfrms opened 3 years ago
const path = require('path');
module.exports = {
resolve: {
alias: {
'@': path.join(__dirname, 'src')
}
},
};
{
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": false,
"jsx": "react",
"outDir": "./dist/",
},
"include": [
"./src/**/*",
]
}
resolve: {
extensions: ['.js', '.jsx', '.tsx', '.ts', ],
alias: {
'@': path.join(__dirname, './src')
}
},
resolve: {
extensions: ['.js', '.jsx', '.tsx', '.ts', ],
alias: {
'@': path.join(__dirname, './src')
},
},
// baseUrl: '.',
vscode & webpack @ alias
$ npx tsc -h
https://www.cnblogs.com/anonymous-ufo/p/16896629.html#5124976\
{
"include": ["src/**/*"],// ✅
"exclude": ["tests/**/*"],
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"jsx": "preserve",
"declaration": false,
"declarationMap": false,
"sourceMap": true,
"outDir": "./build",
"rootDir": "./", // ✅
"removeComments": true,
"downlevelIteration": true,
"isolatedModules": false,
"strict": true,
"noImplicitAny": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"noImplicitThis": true,
"alwaysStrict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"moduleResolution": "node",
"esModuleInterop": true,
"allowUmdGlobalAccess": true,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true
}
}
jsconfig.json 👎
https://code.visualstudio.com/docs/languages/jsconfig
https://github.com/microsoft/vscode/issues/16320