ygj6

Results 94 comments of ygj6

It's an honor to contribute to jquery. Since the PR submission is a little long, I need to spend time sorting out the code.

I'm afraid that it's not supported yet. If we use the ESM format by default, it will depend to the `top-level await` feature, so we have to set the target:'esnext'....

Federation uses a `Top-level await`, which is supported by the following browsers. Change your config `build.target` to `next` or a similar value. ![image](https://user-images.githubusercontent.com/7699524/176994068-8f1d8264-c9aa-41f2-8dcf-3ddd72ae9c70.png) https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await#browser_compatibility

On the host side, you need to use `vite build` to generate a remoteEntry.js, since `vite dev` is unbundled. Of course you can use `vite build --watch` to keep it...

感谢使用`@originjs/vite-plugin-commonjs`,`vite build`的时候由[`@rollup/plugin-commonjs`](https://github.com/vitejs/vite/blob/main/packages/vite/src/node/build.ts#L294)处理commonJS代码,所以`@originjs/vite-plugin-commonjs`只能作用于`vite dev`。 你的问题[`transformMixedEsModules`](https://github.com/rollup/plugins/tree/master/packages/commonjs#transformmixedesmodules)选项可以解决,vite配置如下: ```javascript build: { commonjsOptions: { transformMixedEsModules: true, }, } ``` ---------------------------------------------------------- Thanks for using `@originjs/vite-plugin-commonjs`,`vite build` is handled by [`@rollup/plugin-commonjs`](https://github.com/vitejs/vite/blob/main/packages/vite/src/node/build.ts#L294) for commonJS code, so @originjs/vite-plugin-commonjs can...

vite默认就启用了`@rollup/plugin-commonjs`,不需要配置,`vite build`使用的是`roolup`打包的,也就是说本身roolup的特有插件也只能在`vite build`才会运行 https://github.com/vitejs/vite/blob/main/packages/vite/src/node/build.ts#L294 `vite dev`不需要build,只需要预构建,所以我们这个插件只是补充了`vite dev`使用commonJS的述求,所以才只需要在`vite dev`生效即可。

`vite build`默认已经使用了`@rollup/plugin-commonjs`,所以不需要安装和导入,默认就会对纯cjs文件进行处理,而你的例子中是esm和cjs混用,所以需要开启`transformMixedEsModules`.

感谢你的贡献,当前next已经合并了master的修改,这个PR需要你再整理下,把我们没考虑到的再提交下,再次感谢

The MulanPSL-2.0 we use is also a standard SPDX license. You can find it at https://spdx.org/licenses/MulanPSL-2.0.html. It's close to or even looser than the MIT license. Here's a brief difference...

FYI, I made a simple attempt to support SASS modern API #7170