diff --git a/docs/dist/v1/chartifact.html-wrapper.umd.js b/docs/dist/v1/chartifact.html-wrapper.umd.js new file mode 100644 index 00000000..5980a7e8 --- /dev/null +++ b/docs/dist/v1/chartifact.html-wrapper.umd.js @@ -0,0 +1,174 @@ +(function(global, factory) { + typeof exports === "object" && typeof module !== "undefined" ? factory(exports) : typeof define === "function" && define.amd ? define(["exports"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.Chartifact = global.Chartifact || {})); +})(this, (function(exports2) { + "use strict"; + const htmlMarkdown = ` + + + + + + {{TITLE}} + + + + + + + + + + + + + diff --git a/packages/html-wrapper/umd.ts b/packages/html-wrapper/umd.ts new file mode 100644 index 00000000..6ea497f1 --- /dev/null +++ b/packages/html-wrapper/umd.ts @@ -0,0 +1,5 @@ +/** +* Copyright (c) Microsoft Corporation. +* Licensed under the MIT License. +*/ +export { default as htmlWrapper } from './dist/index.mjs'; diff --git a/packages/html-wrapper/vite.bundle.config.js b/packages/html-wrapper/vite.bundle.config.js new file mode 100644 index 00000000..179520b1 --- /dev/null +++ b/packages/html-wrapper/vite.bundle.config.js @@ -0,0 +1,42 @@ +import { defineConfig } from 'vite'; +import resolve from '@rollup/plugin-node-resolve'; +import commonjs from '@rollup/plugin-commonjs'; + +const commonOutputConfig = { + format: 'umd', + name: 'Chartifact', + extend: true, + globals: { + 'vega': 'vega', + 'vega-lite': 'vegaLite', + }, + entryFileNames: 'chartifact.html-wrapper.umd.js', +}; + +export default defineConfig({ + build: { + lib: { + entry: './umd.ts', + }, + minify: false, + emptyOutDir: false, + rollupOptions: { + // External dependencies that the library expects consumers to provide + external: ['vega', 'vega-lite'], + output: [ + { + ...commonOutputConfig, + dir: './dist/umd', + }, + { + ...commonOutputConfig, + dir: '../../docs/dist/v1', + }, + ], + plugins: [ + resolve(), // Resolves Node modules + commonjs(), // Converts CommonJS to ES6 + ], + }, + }, +});