-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[chore] use vite to bundle examples #7559
Conversation
@@ -17,6 +17,6 @@ | |||
</head> | |||
<body> | |||
<div id="viewDiv"></div> | |||
<script src='app.js'></script> | |||
<script type="module" src='app.js'></script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this approach allow us to change app.js
to app.ts
in the future and have examples in Typescript?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
@@ -10,7 +10,7 @@ Copy the content of this folder to your project. | |||
npm install | |||
# or | |||
yarn | |||
# bundle and serve the app with webpack | |||
# bundle and serve the app with vite | |||
npm start |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it also be a good point to recommend using yarn start
instead? npm start
is a bit unfortunate as it works, but npm start-local
doesn't
"start-local": "webpack-dev-server --env.local --progress --hot --open", | ||
"build": "webpack -p" | ||
"start": "vite --open", | ||
"start-local": "vite --config ../vite.config.local.mjs" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't test apps have a build
command?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't think I ever needed to build one.
examples/vite.config.local.mjs
Outdated
'process.env.GoogleMapsAPIKey': JSON.stringify(process.env.GoogleMapsAPIKey), | ||
'process.env.MapboxAccessToken': JSON.stringify(process.env.MapboxAccessToken) | ||
}, | ||
server: {open: true}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should set port to 8080 to be consistent. For API keys or CORS people may have localhost:8080 whitelisted and a port change causes friction
Change List