Skip to content

Commit

Permalink
fix: svelte.config.js should not be required unless preprocessing
Browse files Browse the repository at this point in the history
  • Loading branch information
mihar-22 committed Sep 2, 2020
1 parent 8aa1bb2 commit 6b3e567
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/transformer.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ const { getSvelteConfig } = require('./svelteconfig.js')

const transformer = (options = {}) => (source, filename) => {
const { debug, compilerOptions, preprocess, rootMode } = options
const svelteConfig = getSvelteConfig(rootMode, filename)

let processed = source

if (preprocess) {
const svelteConfig = getSvelteConfig(rootMode, filename)
const preprocessor = require.resolve('./preprocess.js')
processed = execSync(`node --unhandled-rejections=strict --abort-on-uncaught-exception "${preprocessor}"`, {
env: { PATH: process.env.PATH, source, filename, svelteConfig }
Expand Down

0 comments on commit 6b3e567

Please sign in to comment.