Skip to content

Commit

Permalink
Add shared/index.js
Browse files Browse the repository at this point in the history
Avoids having to use ../shared in optimizeDeps inside vite.config.js.
  • Loading branch information
fwextensions committed Mar 23, 2023
1 parent aaf7302 commit 175d793
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ export default defineConfig({
optimizeDeps: {
include: [
'uswds',
'../shared/metadata',
'../shared/constants'
'shared/constants',
'shared/metadata'
],
esbuildOptions: {
loader: {
Expand Down
4 changes: 4 additions & 0 deletions shared/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
exports = {
...require('./constants'),
...require('./metadata')
};
1 change: 1 addition & 0 deletions shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"metadata"
],
"exports": {
".": "./index.js",
"./constants": "./constants/index.js",
"./metadata": "./metadata/index.js",
"./metadata/*": "./metadata/*.js"
Expand Down

0 comments on commit 175d793

Please sign in to comment.