Skip to content

Commit

Permalink
fix: normalize to .js extensions when compiling libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
amcgee committed Nov 21, 2024
1 parent 6e90419 commit 424e6a0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cli/src/lib/compiler/compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const {
createAppEntrypointWrapper,
createPluginEntrypointWrapper,
} = require('./entrypoints.js')
const { extensionPattern } = require('./extensionHelpers.js')
const { extensionPattern, normalizeExtension } = require('./extensionHelpers.js')

const watchFiles = ({ inputDir, outputDir, processFileCallback, watch }) => {
const compileFile = async (source) => {
Expand Down Expand Up @@ -106,7 +106,11 @@ const compile = async ({
source,
babelConfig
)
await fs.writeFile(destination, result.code)

// Always write .js files
const jsDestination = normalizeExtension(destination)

await fs.writeFile(jsDestination, result.code)
} catch (err) {
reporter.dumpErr(err)
reporter.error(
Expand Down

0 comments on commit 424e6a0

Please sign in to comment.