-
Notifications
You must be signed in to change notification settings - Fork 94
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
It's unreasonable to trigger Inlined implicit external
warning when the related alias was configured.
#201
Comments
Same for me, have you resolved it? |
Not yet. No one responded to me, I could only cancel the alias. |
I just add |
+1 simple aliases like ~/ for src/ also trigger "Inlined implicit external", this with the fact that alias breaks in stub mode and mkdist means unbuild doesn't support alias at all. |
Use relative path in index because of unjs/unbuild#201 Remove abundant packages Rebuilt lockfile & nolyfill Template test should no longer throws when replace the template index
It should not happen if aliases are configured to be bundled or externalized. Please provide a minimal reproduction (ie stackblitz/codesandbox). |
Hello @pi0, heres a reproduction link: The warning is triggered using normal bundle mode and not mkdist, (but mkdist also breaks), alias is configured in both build.config.ts and tsconfig.json |
I just replace ungit with tsup. |
I ran into the same issue… :/ |
Even for simple aliases but with the For anyone who is looking for a workaround, the only one I figured is to use vite in lib mode (config below). It's slower in case of the first run (13-15 seconds for my lib) (but very reliable as it uses // @ts-expect-error
import peerDepsExternal from 'rollup-plugin-peer-deps-external'
import type { LibraryFormats, UserConfig } from 'vite'
import dts from 'vite-plugin-dts'
import noBundle from 'vite-plugin-no-bundle'
import tsconfigPaths from 'vite-tsconfig-paths'
import react from '@vitejs/plugin-react-swc'
export default defineConfig({
{
plugins: [
tsconfigPaths(),
react(),
dts({ include: ['lib'], insertTypesEntry: true }),
noBundle({
root: './lib',
}),
],
build: {
minify: false,
sourcemap: true,
copyPublicDir: false,
reportCompressedSize: false,
lib: {
entry: {
index: resolve(__dirname, 'lib/index.ts')
},
formats: ["es"],
},
rollupOptions: {
plugins: [
peerDepsExternal({
includeDependencies: true,
}),
],
},
},
}
}) |
Can you explain a little bit more? I am facing with this problem with https://github.com/nuxt/module-builder (which is built on top of unbuild), but there is no documents that show how/where to set |
@trandaison |
@sechi747 My current workaround solution: // build.config.ts
import { defineBuildConfig } from "unbuild";
export default defineBuildConfig({
failOnWarn: false,
}); |
Hi @pi0, is this issue on the roadmap? These false positive warnings are very annoying to work with. |
The same thing happens with package.json subpath imports https://nodejs.org/api/packages.html#subpath-imports Here's a minimal reproduction https://stackblitz.com/edit/vitejs-vite-kwryzn?file=src%2Findex.ts Lmk if I should open a new issue. |
Indeed it's happening for my project as well. https://github.com/xsjcTony/remark-magic-link |
There's seems to be the same issue before, and it's fixed #383. |
It's useful to me |
Environment
Node.js version: v18.12.1
Reproduction
https://github.com/Plasticine-Yang/plasticine-monitor
run
pnpm build:browser
can trigger the bug.Describe the bug
It will trigger
Inlined implicit external @/sdk
when I don't config the alias for@
, which is reasonable.However, the
@/sdk
is a path alias point topackages/browser/src/sdk.ts
, it is not a dependency package.So, it should be solved when I configure the alias
@
pointing topackages/browser/src
, but it still trigger theInlined implicit external @/sdk
warning.I'm not sure whether it is a bug or a feature. The issue can be closed if it is a feature.
Additional context
The file imports a module with alias:
packages/browser/src/plugins/error-monitor-plugin/index.ts
:The
@/sdk
points topackages/browser/src/sdk.ts
.build.config.ts
Logs
No response
The text was updated successfully, but these errors were encountered: