-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>
- Loading branch information
1 parent
adbfa8f
commit ba3fc07
Showing
1 changed file
with
55 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import { resolve } from 'path'; | ||
import { defineConfig } from 'vite'; | ||
import dts from 'vite-plugin-dts'; | ||
import pkg from './package.json'; | ||
|
||
const banner = `/*! | ||
* ${pkg.name} v${pkg.version} | ||
* ${pkg.description} | ||
* (c) 2021 ${pkg.author.name}<${pkg.author.email}> | ||
* Released under the ${pkg.license} License | ||
*/ | ||
`; | ||
|
||
export default defineConfig({ | ||
build: { | ||
target: 'esnext', | ||
sourcemap: true, | ||
reportCompressedSize: true, | ||
lib: { | ||
entry: resolve(__dirname, 'src/index.ts'), | ||
name: 'MapboxGlInterpolateHeatmap', | ||
formats: ['es', 'cjs', 'umd'], | ||
fileName: pkg.name, | ||
}, | ||
commonjsOptions: { | ||
extensions: ['.js', '.ts'], | ||
strictRequires: true, | ||
exclude: 'src/**', | ||
include: 'node_modules/**', | ||
}, | ||
rollupOptions: { | ||
// make sure to externalize deps that shouldn't be bundled | ||
// into your library | ||
external: ['mapbox-gl', 'earcut'], | ||
output: { | ||
banner, | ||
exports: 'named', | ||
strict: true, | ||
sourcemap: true, | ||
extend: true, | ||
// Provide global variables to use in the UMD build | ||
// for externalized deps | ||
globals: { | ||
earcut: 'earcut', | ||
'mapbox-gl': 'mapboxgl', | ||
}, | ||
}, | ||
}, | ||
}, | ||
plugins: [ | ||
dts({ | ||
outputDir: ['dist'], | ||
}), | ||
], | ||
}); |