Skip to content

Commit

Permalink
Added option to disable precompilation via vite config (blits: { prec…
Browse files Browse the repository at this point in the history
…ompile: true / false}i).
  • Loading branch information
michielvandergeest committed Jan 4, 2024
1 parent 4b61fa4 commit c58e149
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions vite/preCompiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@ import parser from '../src/lib/templateparser/parser.js'
import generator from '../src/lib/codegenerator/generator.js'

export default function () {
let config
return {
name: 'preCompiler',
configResolved(resolvedConfig) {
config = resolvedConfig
},
transform(source) {
if (config.blits && config.blits.precompile === false) return source
if (source.indexOf('Blits.Component(') > -1 || source.indexOf('Blits.Application(') > -1) {
// get the start of the template key in de component configuration object
const templateKeyRegex = /template:\s*([`"'])*/g
Expand Down

0 comments on commit c58e149

Please sign in to comment.