From 210244f5b4fb2eb025e79c408686fb47631c6ab7 Mon Sep 17 00:00:00 2001 From: Pig Fang Date: Fri, 7 Feb 2020 09:59:10 +0800 Subject: [PATCH] add path alias --- tsconfig.json | 5 ++++- webpack.config.js | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/tsconfig.json b/tsconfig.json index 0af3177d..f57f5d8d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -6,7 +6,10 @@ "moduleResolution": "node", "declaration": false, "baseUrl": ".", - "incremental": true + "incremental": true, + "paths": { + "@/*": ["./resources/assets/src/*"] + } }, "include": [ "resources/assets/src", diff --git a/webpack.config.js b/webpack.config.js index 66d913c7..9c0d3980 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,3 +1,4 @@ +const path = require('path') const webpack = require('webpack') const VueLoaderPlugin = require('vue-loader/lib/plugin') const MiniCssExtractPlugin = require('mini-css-extract-plugin') @@ -115,6 +116,7 @@ const config = { extensions: ['.js', '.ts', '.tsx', '.vue', '.json'], alias: { 'react-dom': '@hot-loader/react-dom', + '@': path.resolve(__dirname, 'resources/assets/src'), }, }, optimization: {