-
Notifications
You must be signed in to change notification settings - Fork 27.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove default next pages compilation from the main babel-loader. #731
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -143,28 +143,21 @@ export default async function createCompiler (dir, { dev = false, quiet = false | |
}, { | ||
loader: 'babel-loader', | ||
include: nextPagesDir, | ||
options: { | ||
exclude (str) { | ||
return /node_modules/.test(str) && str.indexOf(nextPagesDir) !== 0 | ||
}, | ||
query: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It should be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think they support both still. I'll change this in both babel-loaders. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done! |
||
babelrc: false, | ||
cacheDirectory: true, | ||
sourceMaps: dev ? 'both' : false, | ||
plugins: [ | ||
[ | ||
require.resolve('babel-plugin-module-resolver'), | ||
{ | ||
alias: { | ||
'ansi-html': require.resolve('ansi-html'), | ||
'styled-jsx/style': require.resolve('styled-jsx/style') | ||
} | ||
} | ||
] | ||
] | ||
presets: [require.resolve('./babel/preset')] | ||
} | ||
}, { | ||
test: /\.js(\?[^?]*)?$/, | ||
loader: 'babel-loader', | ||
include: [dir, nextPagesDir], | ||
include: [dir], | ||
exclude (str) { | ||
return /node_modules/.test(str) && str.indexOf(nextPagesDir) !== 0 | ||
return /node_modules/.test(str) | ||
}, | ||
query: mainBabelOptions | ||
}]) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nkzawa I tried adding module-resolver plugin to the nextPagesDir's babel-loader. But it seems like we can use only one module-resolver instance at a once.
So, it'll discard all of these if I add a module-resolver there. That's why I added
ansi-html
to this list.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
This is not required anymore by #741 anyway