Skip to content

Commit

Permalink
fix: exports and build
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdehaven committed Dec 19, 2024
1 parent 4f219c0 commit 5f64555
Show file tree
Hide file tree
Showing 8 changed files with 1,479 additions and 1,957 deletions.
5 changes: 5 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
shamefully-hoist=true
strict-peer-dependencies=false
auto-install-peers=true
side-effects-cache=false # Ensure the postinstall script of the lefthook package is executed and hooks are installed
manage-package-manager-versions=true
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
"import": "./dist/kong-markdown.es.js",
"require": "./dist/kong-markdown.umd.js"
},
"./dist/style.css": "./dist/markdown.css",
"./style.css": "./dist/markdown.css",
"./package.json": "./package.json",
"./dist/*": "./dist/*"
},
Expand Down
3,407 changes: 1,459 additions & 1,948 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions src/assets/_mixins.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Add to the global Sass namespace
@use "@kong/design-tokens/tokens/scss/variables" as *;

@mixin toolbar-button {
align-items: center;
background-color: var(--kui-color-background-transparent, $kui-color-background-transparent);
Expand Down
2 changes: 0 additions & 2 deletions src/components/MarkdownContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ watch(() => props.content, (content: string): void => {
</script>

<style lang="scss" scoped>
@import "../assets/mixins";
// Computed component variables
$header-anchor-offset-top: calc(var(--kui-space-80, $kui-space-80) + 2px);
Expand Down
2 changes: 0 additions & 2 deletions src/components/toolbar/MarkdownToolbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,6 @@ onMounted(() => {
</script>

<style lang="scss" scoped>
@import "../../assets/mixins";
.markdown-ui-toolbar {
align-items: center;
background-color: var(--kui-color-background-neutral-weakest, $kui-color-background-neutral-weakest);
Expand Down
2 changes: 0 additions & 2 deletions src/components/toolbar/ToolbarButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ defineProps({
</script>

<style lang="scss" scoped>
@import "../../assets/mixins";
.toolbar-button {
@include toolbar-button;
Expand Down
13 changes: 10 additions & 3 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import { defineConfig } from 'vite'
import VueDevTools from 'vite-plugin-vue-devtools'
import vue from '@vitejs/plugin-vue'
import path, { join } from 'path'
import { fileURLToPath } from 'url'
import path, { dirname, join } from 'path'
import { visualizer } from 'rollup-plugin-visualizer'

const currentDir = dirname(fileURLToPath(import.meta.url))

// Include the rollup-plugin-visualizer if the BUILD_VISUALIZER env var is set to "true"
const buildVisualizerPlugin = process.env.BUILD_VISUALIZER
? visualizer({
Expand Down Expand Up @@ -31,8 +34,12 @@ export default defineConfig({
preprocessorOptions: {
scss: {
// Inject the @kong/design-tokens SCSS variables to make them available for all components.
// This is not needed in host applications.
additionalData: '@use "sass:color";@import "@kong/design-tokens/tokens/scss/variables";',
additionalData: `
@use "sass:color";
// Add to the global Sass namespace
@use "@kong/design-tokens/tokens/scss/variables" as *;
@use "${join(currentDir, './src/assets/_mixins.scss')}" as *;
`,
},
},
},
Expand Down

0 comments on commit 5f64555

Please sign in to comment.