b5080f1010
* Update tailwind example * Update blog-starter example * Update with-next-css example * Update with-quill-js * Update with-rbx-bulma-pro * Remove incompatible example * Update with-react-multi-carousel * Update-with-semantic-ui * Update with-videojs example * Remove @zeit/next-css from package.json of updated examples * Remove deprecated examples * Remove target from all examples * Update package.json * Apply suggestions from code review Co-Authored-By: Joe Haddad <timer@zeit.co> Co-authored-by: Joe Haddad <timer150@gmail.com>
39 lines
953 B
JavaScript
39 lines
953 B
JavaScript
const withMDX = require('@zeit/next-mdx')({
|
|
extension: /.mdx?$/,
|
|
options: {
|
|
hastPlugins: [require('mdx-prism')],
|
|
},
|
|
})
|
|
|
|
module.exports = withMDX({
|
|
target: 'serverless',
|
|
pageExtensions: ['js', 'jsx', 'mdx', 'md'],
|
|
webpack: (config, { defaultLoaders, isServer, dev }) => {
|
|
// Fixes npm packages that depend on `fs` module
|
|
config.node = {
|
|
fs: 'empty',
|
|
module: 'empty',
|
|
}
|
|
|
|
config.module.rules.push({
|
|
test: /\.svg$/,
|
|
use: [
|
|
{
|
|
loader: '@svgr/webpack',
|
|
},
|
|
],
|
|
})
|
|
|
|
if (isServer && !dev) {
|
|
const originalEntry = config.entry
|
|
config.entry = async () => {
|
|
const entries = { ...(await originalEntry()) }
|
|
// This script imports components from the Next app, so it's transpiled to `.next/server/scripts/build-rss.js`
|
|
entries['./posts/rss-feed.js'] = './posts/rss-feed.js'
|
|
return entries
|
|
}
|
|
}
|
|
|
|
return config
|
|
},
|
|
})
|