Skip to content

Commit a4d11fc

Browse files
committed
fix to also work with no preprocessed AST
1 parent f81cc04 commit a4d11fc

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
"test": "npm run build && node test"
3232
},
3333
"devDependencies": {
34-
"eslint": ">=6.0.0",
34+
"eslint": "^7.7.0",
3535
"rollup": "^1",
36-
"svelte": "^3.2.0"
36+
"svelte": "^3.24.1"
3737
}
3838
}

src/preprocess.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ export const preprocess = (text, filename) => {
200200
instancePostOffset = instancePreOffset + instanceDiff;
201201
}
202202

203-
if (module) {
203+
if (module && processedModule) {
204204
module.content.body = processedModule.ast.body;
205205

206206
module.start += modulePreOffset;
@@ -210,7 +210,7 @@ export const preprocess = (text, filename) => {
210210
module.content.end += modulePostOffset;
211211
}
212212

213-
if (instance) {
213+
if (instance && processedInstance) {
214214
instance.content.body = processedInstance.ast.body;
215215

216216
instance.start += instancePreOffset;

0 commit comments

Comments
 (0)