-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(build): Switch from microbundle to vite lib mode
- Loading branch information
1 parent
efebb5c
commit f7cd88e
Showing
11 changed files
with
56 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,2 @@ | ||
/** | ||
* Injected by microbundle, with: | ||
* ``` | ||
* --define __CARTO_API_CLIENT_VERSION=$npm_package_version | ||
* ``` | ||
*/ | ||
declare const __CARTO_API_CLIENT_VERSION: string; | ||
|
||
/** Defined by @deck.gl/core. */ | ||
declare const deck: {VERSION: string | undefined} | undefined; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import {resolve} from 'path'; | ||
import {PluginOption, defineConfig} from 'vite'; | ||
import {readFile} from 'node:fs/promises'; | ||
import typescript from 'rollup-plugin-typescript2'; | ||
|
||
const pkg = JSON.parse(await readFile('./package.json', 'utf-8')); | ||
|
||
// NOTE: 'isolatedModules' must be enabled in tsconfig.json, | ||
// see https://github.com/vitejs/vite/discussions/16680. | ||
export default defineConfig({ | ||
plugins: [{...typescript(), enforce: 'pre'} as PluginOption], | ||
build: { | ||
outDir: 'build', | ||
target: 'esnext', | ||
minify: false, | ||
lib: { | ||
entry: resolve(__dirname, 'src/index.ts'), | ||
fileName: 'api-client', | ||
formats: ['es', 'cjs'], | ||
}, | ||
rollupOptions: { | ||
// Externalize deps that shouldn't be bundled. | ||
external: Object.keys(pkg.dependencies), | ||
}, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters