Skip to content

Commit

Permalink
Fix import
Browse files Browse the repository at this point in the history
  • Loading branch information
styfle committed Jun 28, 2023
1 parent 1ac45ca commit 0911227
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { webpack } from 'next/dist/compiled/webpack/webpack'
import { getBaseSWCOptions } from 'next/src/build/swc/options'
import { readFileSync, writeFileSync, copyFileSync } from 'fs'
import { dirname, join } from 'path'
import { transform } from '../../swc'
import type { webpack } from 'next/dist/compiled/webpack/webpack'
import type { NextConfigComplete } from '../../../server/config-shared'
import { getBaseSWCOptions } from '../../swc/options'
import { transform } from '../../swc'

export class ImageLoaderFilePlugin {
opts: { dev: boolean; config: NextConfigComplete }
Expand Down Expand Up @@ -40,7 +40,12 @@ export class ImageLoaderFilePlugin {
jsConfig: {},
})

const result = await transform(source, swcOpts)
const result = await transform(source, {
...swcOpts,
module: {
type: 'commonjs',
},
})

console.log('result from swc is', result)

Expand Down

0 comments on commit 0911227

Please sign in to comment.