Skip to content
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

Merged
merged 2 commits into from
Jan 5, 2023
Merged

[chore] use vite to bundle examples #7559

merged 2 commits into from
Jan 5, 2023

Conversation

Pessimistress
Copy link
Collaborator

Change List

  • Use vite to bundle all examples and test apps
  • Remove webpack 4 dev dependency

@coveralls
Copy link

coveralls commented Jan 4, 2023

Coverage Status

Coverage: 90.051%. Remained the same when pulling d729d3f on x/vite into 45fb552 on master.

test/apps/mask/app.jsx Show resolved Hide resolved
examples/README.md Outdated Show resolved Hide resolved
@@ -17,6 +17,6 @@
</head>
<body>
<div id="viewDiv"></div>
<script src='app.js'></script>
<script type="module" src='app.js'></script>
Copy link
Collaborator

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?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

examples/playground/json-examples/index.js Outdated Show resolved Hide resolved
examples/vite.config.local.mjs Outdated Show resolved Hide resolved
@@ -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
Copy link
Collaborator

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"
Copy link
Collaborator

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?

Copy link
Collaborator Author

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.

test/apps/mask-orthographic/app.jsx Outdated Show resolved Hide resolved
'process.env.GoogleMapsAPIKey': JSON.stringify(process.env.GoogleMapsAPIKey),
'process.env.MapboxAccessToken': JSON.stringify(process.env.MapboxAccessToken)
},
server: {open: true},
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants