We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
通过 modifyUserConfig 修改 用户配置 ,和直接配置后的 构建产物不同。
方式一 直接配置:
// build.config.mts import { defineConfig } from "@ice/pkg"; // https://pkg.ice.work/reference/config/ export default defineConfig({ transform: { formats: ["es2017"], }, bundle: { polyfill: false, formats: ["es2017"], }, });
方式二 通过插件修改配置:
// build.config.mts import { defineConfig } from "@ice/pkg"; // https://pkg.ice.work/reference/config/ export default defineConfig({ plugins: ["./plugin.mjs"], });
// ./plugin.mjs /** * @type {import('@ice/pkg').Plugin} */ const plugin = (api, options) => { const { modifyUserConfig } = api; modifyUserConfig("transform", { formats: ["es2017"], }); modifyUserConfig("bundle", { polyfill: false, formats: ["es2017"], }); }; export default plugin;
方式一和方式二 构建产物不同,方式二 多构建了 esm 目录产物
The text was updated successfully, but these errors were encountered:
icepkg/packages/pkg/src/plugins/component.ts
Line 18 in de7f295
目前的逻辑是,一个 transform.format 对应一个 task。
transform.format
上面是内置插件会在最前面运行,注册 task 的逻辑先执行,并且依赖 transform.formats。自定义插件通过 modifyUserConfig 没办法修改已注册的 task
transform.formats
modifyUserConfig
Sorry, something went wrong.
我认为这个后面要重构掉,具体的方案要讨论下。
No branches or pull requests
通过 modifyUserConfig 修改 用户配置 ,和直接配置后的 构建产物不同。
方式一 直接配置:
方式二 通过插件修改配置:
方式一和方式二 构建产物不同,方式二 多构建了 esm 目录产物
The text was updated successfully, but these errors were encountered: