mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-25 07:05:11 +00:00
13 lines
566 B
JavaScript
13 lines
566 B
JavaScript
const middleware = {}
|
|
<%= isTest ? '/* eslint-disable dot-notation */' : '' %>
|
|
<% for (const m of middleware) {
|
|
// TODO: remove duplicate logic in v3 (see builder.resolveMiddleware)
|
|
const name = m.name || m.src.replace(new RegExp(`\\.(${extensions})$`), '')
|
|
const dst = m.dst || relativeToBuild(srcDir, dir.middleware, m.src)
|
|
%>
|
|
middleware['<%= name %>'] = require('<%= dst %>')
|
|
middleware['<%= name %>'] = middleware['<%= name %>'].default || middleware['<%= name %>']
|
|
<% } %>
|
|
<%= isTest ? '/* eslint-enable dot-notation */' : '' %>
|
|
export default middleware
|