Created
October 9, 2019 08:22
-
-
Save AlexSwtlsk/ed6b5479728c9f2e47c6d558e38fedc9 to your computer and use it in GitHub Desktop.
Nuxt - Build options with typescript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import NuxtConfiguration from "@nuxt/config"; | |
import { Configuration as WebpackConfiguration } from "webpack"; | |
import { BlogRaw } from "./types"; | |
const { fr, en } = require("./blog/blogs.json"); | |
import { head } from "./config/head"; | |
export default { | |
server: { | |
port: 3003 | |
}, | |
env: {}, | |
head, | |
loading: { color: "#3B8070" }, | |
css: ["~/assets/css/main.css"], | |
build: { | |
extend(config: WebpackConfiguration, ctx) { | |
config.module.rules.push({ | |
test: /\.md$/, | |
loader: "frontmatter-markdown-loader" | |
}); | |
} | |
}, | |
buildModules: ["@nuxt/typescript-build"], | |
modules: ["@nuxtjs/axios"], | |
axios: {}, | |
generate: { | |
routes: ["404"] | |
.concat(fr.map((w: BlogRaw) => `/blog/${w.slug}`)) | |
.concat(en.map((w: BlogRaw) => `/blog/en/${w.slug}`)) | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment