Skip to content

Commit

Permalink
fix(middleware): use cjs syntax (#236)
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Dec 18, 2020
1 parent ed76e04 commit f35b1cc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/serverMiddleware/tailwindConfigViewer.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { withoutTrailingSlash, withTrailingSlash } from '@nuxt/ufo'
import createServer from 'tailwind-config-viewer/server'
const { withoutTrailingSlash, withTrailingSlash } = require('@nuxt/ufo')
const createServer = require('tailwind-config-viewer/server')

const server = createServer({
tailwindConfigProvider: () => process.nuxt ? process.nuxt.$config.tailwind.getConfig() : {}
}).asMiddleware()

export default (req, res) => {
module.exports = (req, res) => {
if (req.originalUrl === withoutTrailingSlash(process.nuxt.$config.tailwind.viewerPath)) {
res.writeHead(301, { Location: withTrailingSlash(req.originalUrl) })
res.end()
Expand Down

0 comments on commit f35b1cc

Please sign in to comment.