nuxt-edge

Add a slask / at the end of every routes in Nuxt.js

我与影子孤独终老i 提交于 2020-01-06 01:17:21
问题 For a purpose of SEO i've been asked to add a slash at the end of every routes of my nuxt project. For example myapp.com/company should be myapp.com/company/ Is there a clean way to do that in Nuxt ? 回答1: ok i found the solution by writting a redirection in a middleware on serverside, so first i added to nuxt.config.js this : serverMiddleware: ["~/servermiddleware/seo.js"], then i created this file /servermiddleware/seo.js : const redirects = require('../301.json'); module.exports = function

How to use webpack dev proxy with Nuxt

烂漫一生 提交于 2019-12-11 06:19:29
问题 Using Nuxt to develop a universal JS app, I'm attempting to configure webpack's dev proxy so that, in development only , requests to /api get proxied to http://127.0.0.1:500/api where they'll reach a Python REST API. Following the Nuxt docs, I've extended the webpack config in nuxt.config.js like so: build: { extend (config, { isDev }) { // Proxy /api to Python only in dev if (isDev) { const devServer = { proxy: { '/api': 'http://127.0.0.1:5000' } } config.devServer = devServer; } } } If I

How to add a polyfill to nuxt 2.0?

旧城冷巷雨未停 提交于 2019-11-28 07:34:34
In Nuxt 1.4.2 , I had the following in my nuxt.config.js : build: { vendor: ['babel-polyfill'], babel: { presets: [ ['vue-app', { useBuiltIns: true, targets: { ie: 11, uglify: true }, }, ], ], }, }, It seems that all of this is broken in Nuxt 2.0 . At a minimum I'm looking to polyfill enough to get IE 11 working. Here's what I've tried: Using vendor as I used to Removing build.babel allowed the build process to work: build: { vendor: ['babel-polyfill'], }, But I think build.vendor is just ignored now, so this seems to do nothing. Using polyfill.io I tried adding: script: [ { src: 'https://cdn

How to add a polyfill to nuxt 2.0?

天大地大妈咪最大 提交于 2019-11-26 16:25:27
问题 In Nuxt 1.4.2 , I had the following in my nuxt.config.js : build: { vendor: ['babel-polyfill'], babel: { presets: [ ['vue-app', { useBuiltIns: true, targets: { ie: 11, uglify: true }, }, ], ], }, }, It seems that all of this is broken in Nuxt 2.0 . At a minimum I'm looking to polyfill enough to get IE 11 working. Here's what I've tried: Using vendor as I used to Removing build.babel allowed the build process to work: build: { vendor: ['babel-polyfill'], }, But I think build.vendor is just