Skip to content

Commit

Permalink
fix(nitro): import rollup as cjs
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Oct 25, 2021
1 parent 29dbbca commit 1d9602c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/build.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { relative, resolve, join } from 'pathe'
import consola from 'consola'
import { rollup, watch as rollupWatch } from 'rollup'
import * as rollup from 'rollup/dist/rollup.js'
import fse from 'fs-extra'
import { printFSTree } from './utils/tree'
import { getRollupConfig } from './rollup/config'
Expand Down Expand Up @@ -92,7 +92,7 @@ async function _build (nitroContext: NitroContext) {
await writeTypes(nitroContext)

consola.start('Building server...')
const build = await rollup(nitroContext.rollupConfig).catch((error) => {
const build = await rollup.rollup(nitroContext.rollupConfig).catch((error) => {
consola.error('Rollup error: ' + error.message)
throw error
})
Expand All @@ -110,7 +110,7 @@ async function _build (nitroContext: NitroContext) {
}

function startRollupWatcher (nitroContext: NitroContext) {
const watcher = rollupWatch(nitroContext.rollupConfig)
const watcher = rollup.watch(nitroContext.rollupConfig)
let start: number

watcher.on('event', (event) => {
Expand Down
2 changes: 1 addition & 1 deletion src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"p-debounce": "^4.0.0",
"pathe": "^0.2.0",
"pretty-bytes": "^5.6.0",
"rollup": "^2.58.0",
"rollup": "^2.58.1",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-visualizer": "^5.5.2",
"serve-placeholder": "^1.2.4",
Expand Down

0 comments on commit 1d9602c

Please sign in to comment.