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
Transitive dependencies are not pre-bundled #1704
Comments
I believe you should be using include, not exclude for your optimizeDeps setting. |
@nrayburn-tech thanks for the comment. I added that line to get around this warning:
I updated the demo, and now I have even more weird error:
This is my source import React from "react";
import { Container } from "@awsui/components-react";
import "@awsui/global-styles/index.css";
function App() {
return <Container>Test content</Container>;
}
export default App; this is what I receive in the browser: import __vite__cjsImport0_react from "/node_modules/.vite/react/index.js?v=82aa6671"
const React = __vite__cjsImport0_react.__esModule ? __vite__cjsImport0_react.default : __vite__cjsImport0_react;
import __vite__cjsImport1__awsui_componentsReact from "/node_modules/.vite/react/index.js?v=82aa6671"
const Container = __vite__cjsImport1__awsui_componentsReact["Container"];
import "/node_modules/@awsui/global-styles/index.css?v=82aa6671";
function App() {
return /* @__PURE__ */ React.createElement(Container, null, "Test content");
}
export default App; Note the line For some reason the import was mapped to react and not the UI-library. Perhaps it is caused by both paths ending with |
I submitted a PR against your repo to get it working. Currently, the When trying to import in what would be the ideal way, |
This is a bug I'm fixing. |
Tested |
Describe the bug
When a package has a commonjs dependency, it is loaded into browser without pre-bundling
Reproduction
I put up a demo here: https://github.com/just-boris/vite-awsui
When install and run it in browser, you will see the following error:
This is happening, because I am using a module, which depends on
balanced-match
. Since it is not in mydependencies
list, it is not getting pre-bundledSystem Info
vite
version: 2.0.0-beta.45The text was updated successfully, but these errors were encountered: