Skip to content

Commit

Permalink
build(templates): remove webpack file path alias
Browse files Browse the repository at this point in the history
  • Loading branch information
wang1212 committed May 19, 2021
1 parent 2e75fcf commit 037f605
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
14 changes: 8 additions & 6 deletions templates/app/config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,14 @@ module.exports = ({ NODE_ENV, SRC_DIR, BUILD_DIR, isEnvDevelopment = NODE_ENV ==
},
resolve: {
extensions: ['.ts', '.js', '.mjs', '.json'],
alias: {
components: path.resolve('./src/components/'),
utils: path.resolve('./src/utils/'),
assets: path.resolve('./src/assets/'),
vendors: path.resolve('./src/vendors/'),
},
// Alias will cause IntelliSense to be invalid.
// Although it can be fixed, it will increase configuration complexity and cause a series of problems.
// alias: {
// components: path.resolve('./src/components/'),
// utils: path.resolve('./src/utils/'),
// assets: path.resolve('./src/assets/'),
// vendors: path.resolve('./src/vendors/'),
// },
},
module: {
rules: [
Expand Down
16 changes: 9 additions & 7 deletions templates/react-app/config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,15 @@ module.exports = ({ NODE_ENV, SRC_DIR, BUILD_DIR, isEnvDevelopment = NODE_ENV ==
},
resolve: {
extensions: ['.tsx', '.ts', '.jsx', '.js', '.mjs', '.json'],
alias: {
components: path.resolve('./src/components/'),
models: path.resolve('./src/models/'),
utils: path.resolve('./src/utils/'),
assets: path.resolve('./src/assets/'),
vendors: path.resolve('./src/vendors/'),
},
// Alias will cause IntelliSense to be invalid.
// Although it can be fixed, it will increase configuration complexity and cause a series of problems.
// alias: {
// components: path.resolve('./src/components/'),
// models: path.resolve('./src/models/'),
// utils: path.resolve('./src/utils/'),
// assets: path.resolve('./src/assets/'),
// vendors: path.resolve('./src/vendors/'),
// },
},
module: {
rules: [
Expand Down

0 comments on commit 037f605

Please sign in to comment.