Skip to content

Commit

Permalink
Merge pull request #223 from x-atlas-consortia/tjmadonna/add-@-path-a…
Browse files Browse the repository at this point in the history
…lias

Add '@' path alias for cleaner imports
  • Loading branch information
yuanzhou authored Aug 27, 2024
2 parents 6ddd278 + c14948d commit d8b74a5
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 13 deletions.
21 changes: 21 additions & 0 deletions jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": [
"src/*"
]
}
},
"include": [
"src/**/*"
],
"exclude": [
"**/.next",
"**/dist",
"**/log",
"**/node_modules",
"**/hubmap-docker",
"**/sennet-docker"
]
}
7 changes: 0 additions & 7 deletions src/jsconfig.json

This file was deleted.

21 changes: 19 additions & 2 deletions src/next.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,24 @@
const path = require('path')

/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
transpilePackages: [ 'antd', '@ant-design', 'rc-util', 'rc-tree', 'rc-table', 'rc-pagination', 'rc-picker', 'rc-notification', 'rc-tooltip' ]
reactStrictMode: true,
webpack: (config, options) => {
// Set the @ alias for the src directory
config.resolve.alias['@'] = path.resolve(__dirname)
return config
},
transpilePackages: [
'antd',
'@ant-design',
'rc-util',
'rc-tree',
'rc-table',
'rc-pagination',
'rc-picker',
'rc-notification',
'rc-tooltip'
]
}

module.exports = nextConfig
8 changes: 4 additions & 4 deletions src/pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import '../styles/main.css'
import '@/styles/main.css'
import 'bootstrap/dist/css/bootstrap.min.css'
import { Roboto } from 'next/font/google'
import { AppProvider } from '../context/AppContext'
import useContent from "../hooks/useContent";
import useGoogleTagManager from "../hooks/useGoogleTagMananger";
import { AppProvider } from '@/context/AppContext'
import useContent from "@/hooks/useContent";
import useGoogleTagManager from "@/hooks/useGoogleTagMananger";

const roboto = Roboto({
weight: '500',
Expand Down

0 comments on commit d8b74a5

Please sign in to comment.