1
1
mirror of https://github.com/mdx-js/mdx.git synced 2024-10-26 16:20:29 +03:00

Improve Vercel build (#1656)

This commit is contained in:
Titus 2021-09-15 09:36:52 +02:00 committed by GitHub
parent 952f6dc524
commit 36cb41bc6c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 22 additions and 28 deletions

View File

@ -1,11 +1,11 @@
/build/
.cache/
.next/
build/
coverage/
dist/
fixtures/
node_modules/
public/
*.min.*
/build/
*.md
*.mdx

View File

@ -1,3 +1,2 @@
examples
node_modules
.*cache

View File

@ -19,7 +19,7 @@ const gh = new URL('https://github.com/mdx-js/mdx/')
export const config = {
input: new URL('./docs/', git),
output: new URL('./build/', git),
output: new URL('./public/', git),
git,
gh,
ghBlob: new URL('./blob/' + branch + '/', gh),

14
package-lock.json generated
View File

@ -134,6 +134,7 @@
}
},
"examples/gatsby": {
"name": "gatsby-example",
"dependencies": {
"@mdx-js/mdx": "^1.0.0",
"@mdx-js/react": "^1.0.0",
@ -406,6 +407,7 @@
}
},
"examples/next": {
"name": "next-example",
"dependencies": {
"@mdx-js/loader": "^1.0.0",
"@mdx-js/mdx": "^1.0.0",
@ -695,6 +697,7 @@
}
},
"examples/parcel": {
"name": "parcel-example",
"devDependencies": {
"@mdx-js/react": "^1.0.0",
"@parcel/transformer-mdx": "^2.0.0-rc.0",
@ -744,6 +747,7 @@
}
},
"examples/react-web-components": {
"name": "react-web-components-example",
"dependencies": {
"@mdx-js/loader": "^1.0.0",
"@mdx-js/mdx": "^1.0.0",
@ -1031,6 +1035,7 @@
}
},
"examples/terminal": {
"name": "terminal-example",
"license": "MIT",
"dependencies": {
"@mdx-js/mdx": "^1.0.0",
@ -1310,6 +1315,7 @@
}
},
"examples/vue": {
"name": "vue-example",
"devDependencies": {
"@mdx-js/vue-loader": "2.0.0-next.9",
"@vue/cli-plugin-babel": "^4.0.0",
@ -1319,6 +1325,7 @@
}
},
"examples/webpack": {
"name": "webpack-example",
"license": "MIT",
"devDependencies": {
"@babel/core": "^7.0.0",
@ -47519,6 +47526,7 @@
}
},
"packages/loader": {
"name": "@mdx-js/loader",
"version": "2.0.0-next.9",
"license": "MIT",
"dependencies": {
@ -47569,6 +47577,7 @@
}
},
"packages/mdx": {
"name": "@mdx-js/mdx",
"version": "2.0.0-next.9",
"license": "MIT",
"dependencies": {
@ -47899,6 +47908,7 @@
}
},
"packages/preact": {
"name": "@mdx-js/preact",
"version": "2.0.0-next.9",
"license": "MIT",
"devDependencies": {
@ -47914,6 +47924,7 @@
}
},
"packages/react": {
"name": "@mdx-js/react",
"version": "2.0.0-next.9",
"license": "MIT",
"devDependencies": {
@ -48036,6 +48047,7 @@
}
},
"packages/runtime": {
"name": "@mdx-js/runtime",
"version": "2.0.0-next.9",
"license": "MIT",
"dependencies": {
@ -48060,6 +48072,7 @@
}
},
"packages/vue": {
"name": "@mdx-js/vue",
"version": "2.0.0-next.9",
"license": "MIT",
"devDependencies": {
@ -48072,6 +48085,7 @@
}
},
"packages/vue-loader": {
"name": "@mdx-js/vue-loader",
"version": "2.0.0-next.9",
"license": "MIT",
"dependencies": {

View File

@ -9,10 +9,6 @@
"license": "MIT",
"private": true,
"type": "module",
"#": "For `vercel` (to do: set it in vercel dashboard instead)",
"engines": {
"node": ">=14"
},
"workspaces": [
"packages/babel-plugin-remove-export-keywords",
"packages/react",
@ -41,7 +37,7 @@
"postinstall": "patch-package",
"prepare": "husky install",
"clean": "npm exec -c \"rimraf node_modules\" --workspaces",
"docs-prep": "node website/prep.js && postcss docs/_asset/index.css -o build/index.css",
"docs-prep": "node website/prep.js && postcss docs/_asset/index.css -o public/index.css",
"docs-bundle-dev": "NODE_ENV=development node website/bundle.js",
"docs-bundle-prod": "NODE_ENV=production node website/bundle.js",
"docs-generate": "NODE_LOADER_CONFIG=website/loader-react-server.js node --no-warnings --experimental-loader @node-loader/core --conditions=react-server website/generate.server.js",
@ -53,7 +49,6 @@
"docs-deploy": "vercel && vercel alias $(pbpaste) mdxjs.com && vercel alias $(pbpaste) www.mdxjs.com",
"format": "npm run lint -- --fix",
"lint": "eslint --ext .jsx --report-unused-disable-directives --cache .",
"vercel-build": "npm run docs-prod",
"publish-ci": "# lerna publish -y --canary --preid ci --pre-dist-tag ci",
"publish-next": "# lerna publish --force-publish=\"*\" --pre-dist-tag next --preid next",
"test-api": "npm run test-api --workspaces --if-present",

View File

@ -1,16 +1,4 @@
{
"version": 2,
"name": "mdx",
"alias": ["v2.mdxjs.com"],
"public": true,
"trailingSlash": true,
"builds": [
{
"src": "package.json",
"use": "@vercel/static-build",
"config": {
"distDir": "build"
}
}
]
"trailingSlash": true
}

View File

@ -18,9 +18,9 @@ webpack(
)
],
output: {
// RSC puts all chunks in `build/` (perhaps due to my weird doing),
// but on a page `build/folder/index.html`, RSC/WP will then load
// `build/folder/chunk.js`, even though its at `build/chunk.js`.
// RSC puts all chunks in `public/` (perhaps due to my weird doing),
// but on a page `public/folder/index.html`, RSC/WP will then load
// `public/folder/chunk.js`, even though its at `public/chunk.js`.
// This fixes that!
publicPath: '/',
path: url.fileURLToPath(config.output),

View File

@ -45,8 +45,6 @@ async function main() {
})
)
console.log('files:', await globby('**/index.nljson', {cwd: fileURLToPath(config.output)}));
const files = (
await globby('**/index.nljson', {cwd: fileURLToPath(config.output)})
).map(d => new URL(d, config.output))