nekocode / antd-dayjs-vite-plugin

A Vite port of antd-dayjs-webpack-plugin. Day.js vite plugin for Ant Design (antd).
https://www.npmjs.com/package/antd-dayjs-vite-plugin
MIT License
18 stars 0 forks source link

编译报错 #3

Closed transtone closed 3 years ago

transtone commented 3 years ago
yarn run v1.22.10
$ vite build
vite v2.4.3 building for production...
✓ 1 modules transformed.
[vite]: Rollup failed to resolve import "/init-dayjs-vite-plugin-entry.js" from "index.html".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
`build.rollupOptions.external`
error during build:
Error: [vite]: Rollup failed to resolve import "/init-dayjs-vite-plugin-entry.js" from "index.html".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
`build.rollupOptions.external`
    at onRollupWarning (D:\code\node_modules\vite\dist\node\chunks\dep-f2b4ca46.js:51734:19)
    at onwarn (D:\code\node_modules\vite\dist\node\chunks\dep-f2b4ca46.js:51519:13)
    at Object.onwarn (D:\code\node_modules\rollup\dist\shared\rollup.js:20470:13)
    at ModuleLoader.handleResolveId (D:\code\node_modules\rollup\dist\shared\rollup.js:19819:26)
    at D:\code\node_modules\rollup\dist\shared\rollup.js:19766:22
    at async Promise.all (index 0)
    at async ModuleLoader.fetchStaticDependencies (D:\code\node_modules\rollup\dist\shared\rollup.js:19764:34)
    at async Promise.all (index 0)
    at async ModuleLoader.fetchModule (D:\code\node_modules\rollup\dist\shared\rollup.js:19740:9)
    at async Promise.all (index 0)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

这个插件在打包之后还需要加载的吗?

nekocode commented 3 years ago

这个插件会插入部分代码。你这个问题我晚上抽空看看,感谢反馈

nekocode commented 3 years ago

@transtone 抱歉,晚上才有空仔细改。可以帮忙试试 1.1.3 版本解决这个问题了么?(我这边测试过没问题

transtone commented 3 years ago

更新到 1.1.3已经编译没有问题了。测试功能正常。