Skip to content

Commit 8de3e12

Browse files
authored
fix(content): avoid using commonjs for runtime (vite support) (#805)
1 parent 21635e2 commit 8de3e12

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

packages/content/templates/nuxt-content.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const info = require('property-information')
1+
import info from 'property-information'
22

33
const rootKeys = ['class-name', 'class', 'style']
44

packages/content/templates/plugin.client.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,12 @@ export default (ctx, inject) => {
2828
ctx.$content = $content
2929

3030
<% if (options.watch) { %>
31-
const logger = require('consola').withScope('@nuxt/content')
31+
const logger = {
32+
log: (...args) => console.log('[@nuxt/content]', ...args),
33+
warn: (...args) => console.warn('[@nuxt/content]', ...args),
34+
}
3235
if (!window.WebSocket) {
33-
logger.warn('[@nuxt/content] Could not activate hot reload, your browser does not support WebSocket.')
36+
logger.warn('Could not activate hot reload, your browser does not support WebSocket.')
3437
return
3538
}
3639
let ws = null

packages/content/templates/query-builder.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class QueryBuilder {
1+
export default class QueryBuilder {
22
constructor (url, { deep = false, text = false } = {}) {
33
this.url = url
44
this.params = {
@@ -110,5 +110,3 @@ class QueryBuilder {
110110
})
111111
}
112112
}
113-
114-
module.exports = QueryBuilder

0 commit comments

Comments
 (0)