Skip to content

Commit

Permalink
fix: use cjs export for exports with alias
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Nov 19, 2020
1 parent 60b8c6c commit 00f911b
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src.runtime/mock/empty.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export default {}
module.exports = {}
2 changes: 1 addition & 1 deletion src.runtime/mock/noop.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export default () => {}
module.exports = () => {}
2 changes: 1 addition & 1 deletion src.runtime/mock/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ function createMock (name: string, overrides: any = {}): any {
})
}

export default createMock('mock')
module.exports = createMock('mock')
4 changes: 2 additions & 2 deletions src.runtime/npm/consola.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import mock from '../mock/proxy'
const mock = require('../mock/proxy')

export default mock.__createMock__('consola', {
module.exports = mock.__createMock__('consola', {
...console
})
2 changes: 1 addition & 1 deletion src.runtime/npm/depd.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// https://www.npmjs.com/package/depd

export default function depd (_namespace: string) {
module.exports = function depd (_namespace: string) {
function deprecate () { }
deprecate.function = (fn: any) => fn
deprecate.property = () => {}
Expand Down
2 changes: 1 addition & 1 deletion src.runtime/npm/mime-db.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// https://www.npmjs.com/package/mime-db

export default {
module.exports = {
'text/html': {
source: 'iana',
compressible: true,
Expand Down
5 changes: 2 additions & 3 deletions src.runtime/npm/mime.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// https://www.npmjs.com/package/mime

// @ts-ignore
import _mime from '_mime'
const _mime = require('_mime')

const mime = { ..._mime }

Expand All @@ -15,4 +14,4 @@ mime.load = noop
mime.default_type = 'application/octet-stream'
mime.charsets = { lookup: () => 'UTF-8' }

export default mime
module.exports = mime
2 changes: 1 addition & 1 deletion src.runtime/shims/process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ global.process = global.process || {}
// TODO: apply only non-existing keys
Object.assign(global.process, require('_process/browser.js'))

export default global.process
module.exports = global.process

0 comments on commit 00f911b

Please sign in to comment.