Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions src/lib/js/constants.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
import pkg from '../../../package.json' with { type: 'json' }
import { uuid } from './common/utils/index.mjs'

// NOTE: The following import uses Vite's '?raw' query parameter to import the SVG as a string.
// This will only work in Vite environments. In non-Vite environments, BUNDLED_SVG_SPRITE will be null.
let BUNDLED_SVG_SPRITE = null;
try {
// Vite-specific import. Will fail in non-Vite environments.
// eslint-disable-next-line import/no-unresolved
BUNDLED_SVG_SPRITE = require('../../lib/icons/formeo-sprite.svg?raw');
} catch (e) {
// Fallback: BUNDLED_SVG_SPRITE remains null.
}
export { BUNDLED_SVG_SPRITE };
export { default as BUNDLED_SVG_SPRITE } from '../../lib/icons/formeo-sprite.svg?raw'

const name = pkg.name
export const version = pkg.version
Expand Down
2 changes: 1 addition & 1 deletion vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const sharedConfig = {
export default defineConfig({
...sharedConfig,
root: 'src/demo',
base: process.env.NODE_ENV === 'production' ? '/formeo/' : '/',
base: '/',
resolve: {
alias: {
formeo: resolve(__dirname, 'src/lib/js/index.js'),
Expand Down
Loading