Skip to content

Commit

Permalink
fixup module-source
Browse files Browse the repository at this point in the history
  • Loading branch information
kriskowal committed Oct 26, 2024
1 parent 31ed756 commit d937fd5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions packages/module-source/src/transform-source.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const makeTransformSource = (makeModulePlugins, babel = null) => {
const ast = parseBabel(source, {
sourceType,
tokens: true,
createParenthesizedExpression: true,
createParenthesizedExpressions: true,
});

traverseBabel(ast, visitorFromPlugin(analyzePlugin));
Expand All @@ -44,8 +44,9 @@ export const makeTransformSource = (makeModulePlugins, babel = null) => {
sourceFileName: sourceMapUrl,
sourceMaps,
inputSourceMap: sourceMap,
retainLines: true,
experimental_preserveFormat: true,
preserveFormat: true,
retainLines: true,
verbatim: true,
},
source,
Expand Down
3 changes: 2 additions & 1 deletion packages/module-source/test/module-source.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ test('export default', t => {
function initialize(t, source, options = {}) {
const { endowments, imports = new Map() } = options;
const record = new ModuleSource(source);
// t.log(record.__syncModuleProgram__);
t.log(source);
t.log(record.__syncModuleProgram__);
const liveUpdaters = {};
const onceUpdaters = {};
const namespace = {};
Expand Down
2 changes: 1 addition & 1 deletion packages/module-source/test/preserve-format.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import url from 'url';
import fs from 'fs';
import test from 'ava';
import { ModuleSource } from '../src/module-source.js';
import './lockdown.js';
import './_lockdown.js';

function readFixture(filename) {
return fs.readFileSync(
Expand Down

0 comments on commit d937fd5

Please sign in to comment.