Skip to content

Commit

Permalink
Support mdx (#163)
Browse files Browse the repository at this point in the history
  • Loading branch information
aralroca authored May 15, 2020
1 parent 6ad4cd6 commit 75498d6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cli/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ function isNextInternal(pagePath) {
}

function clearPageExt(page) {
const rgx = /(\/index.jsx)|(\/index.js)|(\/index.tsx)|(\/index.ts)|(\.jsx)|(\.js)|(\.tsx)|(\.ts)/gm
const rgx = /(\/index.jsx)|(\/index.js)|(\/index.tsx)|(\/index.ts)||(\/index.mdx)|(\.jsx)|(\.js)|(\.tsx)|(\.ts)|(\.mdx)/gm

return page.replace(rgx, '')
}
Expand Down Expand Up @@ -205,7 +205,7 @@ function buildPageLocale({ prefix, pagePath, namespaces, lang, path }) {
const [filename] = finalPath.split('/').reverse()
const dirs = finalPath.replace(`/${filename}`, '')
fs.mkdirSync(dirs, { recursive: true })
fs.writeFileSync(finalPath.replace(/(\.tsx|\.ts)$/, '.js'), template)
fs.writeFileSync(finalPath.replace(/(\.tsx|\.ts|\.mdx)$/, '.js'), template)
}

function copyFolderRecursiveSync(source, targetFolder) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "next-translate",
"version": "0.16.0-canary.4",
"version": "0.16.0-canary.5",
"description": "Next.js utility to translate pages without the need of a server (static i18n pages generator).",
"license": "MIT",
"keywords": [
Expand Down

0 comments on commit 75498d6

Please sign in to comment.