mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
webpack: fix loader exclude settings
This commit is contained in:
parent
becae90375
commit
ba2e2aced9
|
@ -57,7 +57,9 @@ export default async function createCompiler (dir, { hotReload = false } = {}) {
|
|||
test: /\.js$/,
|
||||
loader: 'emit-file-loader',
|
||||
include: [dir, nextPagesDir],
|
||||
exclude: /node_modules/,
|
||||
exclude (str) {
|
||||
return /node_modules/.test(str) && str.indexOf(nextPagesDir) !== 0
|
||||
},
|
||||
query: {
|
||||
name: 'dist/[path][name].[ext]'
|
||||
}
|
||||
|
@ -71,7 +73,9 @@ export default async function createCompiler (dir, { hotReload = false } = {}) {
|
|||
test: /\.js$/,
|
||||
loader: 'babel',
|
||||
include: [dir, nextPagesDir],
|
||||
exclude: /node_modules/,
|
||||
exclude (str) {
|
||||
return /node_modules/.test(str) && str.indexOf(nextPagesDir) !== 0
|
||||
},
|
||||
query: {
|
||||
presets: ['es2015', 'react'],
|
||||
plugins: [
|
||||
|
|
Loading…
Reference in a new issue