vite.config.js 538 B

12345678910111213141516171819202122232425
  1. import { defineConfig } from 'vite'
  2. const path = require('path')
  3. // https://vitejs.dev/config/
  4. export default defineConfig({
  5. build: {
  6. target: 'es2015',
  7. lib: {
  8. entry: path.resolve(__dirname, './src/index.js'),
  9. name: 'tiny-whiteboard',
  10. fileName: format => `tiny-whiteboard.${format}.js`
  11. }
  12. }
  13. })
  14. /*
  15. "main": "./dist/tiny-whiteboard.umd.js",
  16. "module": "./dist/tiny-whiteboard.es.js",
  17. "exports": {
  18. ".": {
  19. "import": "./dist/tiny-whiteboard.es.js",
  20. "require": "./dist/tiny-whiteboard.umd.js"
  21. }
  22. }
  23. */