Closed sunm19810-pki closed 1 year ago
Hi @sunm19810-pki ,
Version 0.3.7 seems to be working in this simple react demo page - https://github.com/tnrich/ove-react-demo-repo
Does that demo work for you? In what ways is your set up different from that one?
Thanks
@tnrich, it seems works fine with vite
, but for webpack
, it cannot load the the src/index.js
as the source code
It always shows an error like this.
Module parse failed: 'import' and 'export' may appear only with 'sourceType: module' (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
> import "@fontsource/ubuntu-mono";
| import { FocusStyleManager } from "@blueprintjs/core";
| import { showContextMenu } from "@teselagen/ui";
@tnrich you can try this repo https://github.com/XingGao-PKI/my-app
Hi @tnrich, if we want to make the latest ove package been easily used in webpack, we may need to change some configurations in the vite.react.config.ts
, maybe I can raise a PR tomorrow for it. Mainly need to change formats:
, external
of vite.react.config.ts
file. And we need to change some value in publish.mjs
to make the published package.json
file able to be recognized as a es module.
@sunm19810-pki thanks for looking into this. I'd be happy to review a PR if you make one.
Ok, @XingGao-PKI @sunm19810-pki I published a new version of ove 0.3.9 that should work for vite and webpack builds. I added a vite and webpack demo to tg-oss
To try out the webpack demo within tg-oss run the following commands:
cd tg-oss;
yarn;
nx run:ove build;
cd example-demos/oveWebpackDemo && yarn && yarn start
You should see something like this:
Lemme know if that works for y'all
Thanks very much @tnrich, it indeed work now. We actually had similar code PR for webpack building, but we decide to use the previous version as the new version may need some time, it is really good as the new version is published so fast.
Awesome, glad to hear it!
Hi @tnrich, it seems the latest 'ove' version (0.3.7) can not be imported correctly, can we publish the 'ove' package and other packages like 'ui' without 'react' or 'react-dom' bundled (open-vector-editor do not set these two packages in the dependencies, it set the two in the peerDependencies and devDependencies)
currently published npm packages can not be used as es module easily. Thanks