Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: disable theme check tag on the generated snippet #149

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
7 changes: 4 additions & 3 deletions packages/vite-plugin-shopify/src/html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ export default function shopifyHTML (options: Required<Options>): Plugin {
debug({ address, viteDevServerUrl })

const reactPlugin = config.plugins.find(plugin => plugin.name === 'vite:react-babel' || plugin.name === 'vite:react-refresh')

const viteTagSnippetContent = viteTagDisclaimer + viteTagEntryPath(config.resolve.alias, options.entrypointsDir, viteTagSnippetName) + viteTagSnippetDev(viteDevServerUrl, options.entrypointsDir, reactPlugin)

// Write vite-tag snippet for development server
fs.writeFileSync(viteTagSnippetPath, viteTagSnippetContent)
}
Expand Down Expand Up @@ -141,7 +141,8 @@ export default function shopifyHTML (options: Required<Options>): Plugin {
}
}

const viteTagDisclaimer = '{% comment %}\n IMPORTANT: This snippet is automatically generated by vite-plugin-shopify.\n Do not attempt to modify this file directly, as any changes will be overwritten by the next build.\n{% endcomment %}\n'
const disableThemeCheckTag = '{% # theme-check-disable %}\n'
const viteTagDisclaimer = `${disableThemeCheckTag}{% comment %}\n IMPORTANT: This snippet is automatically generated by vite-plugin-shopify.\n Do not attempt to modify this file directly, as any changes will be overwritten by the next build.\n{% endcomment %}\n`

// Generate liquid variable with resolved path by replacing aliases
const viteTagEntryPath = (
Expand Down
Loading