Skip to content

Commit

Permalink
feat: Add a console log when using IIFE.
Browse files Browse the repository at this point in the history
  • Loading branch information
s3xysteak committed May 22, 2024
1 parent 9b15f50 commit e1bfbe9
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 5 deletions.
7 changes: 7 additions & 0 deletions demo/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import antfu from '@antfu/eslint-config'

export default antfu()
export default antfu({
rules: {
'no-console': 'off',
},
})
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@
"vite": "^5.0.0"
},
"dependencies": {
"consola": "^3.2.3",
"vite-plugin-externals": "^0.6.2",
"vite-plugin-static-copy": "^1.0.4"
},
"devDependencies": {
"@antfu/eslint-config": "^2.18.0",
"@types/node": "^20.12.12",
"consola": "^3.2.3",
"eslint": "^8.57.0",
"esno": "^4.7.0",
"typescript": "^5.4.5",
Expand Down
6 changes: 3 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src/core/importCesium.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import type { Plugin, ResolvedConfig } from 'vite'
import { consola } from 'consola'
import { isString } from './utils'

export function importCesium(path: (base: string) => string, apply?: Plugin['apply']): Plugin {
let base: ResolvedConfig['base']

apply === 'serve' && consola.info(`[vite-plugin-cesium-build]: The warning message like: \`Sourcemap for "..." points to missing source files\` is expected and is a bug in \`Cesium\'s IIFE\`. You can ignore it. See the @link \`https://github.com/CesiumGS/cesium/issues/11993\` for details.`)

return {
name: `vite-plugin-cesium-build:importCesium${isString(apply) ? `:${apply}` : ''}`,
apply,
Expand Down

0 comments on commit e1bfbe9

Please sign in to comment.