Skip to content

Commit ba2e2ac

Browse files
committed
webpack: fix loader exclude settings
1 parent becae90 commit ba2e2ac

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

server/build/webpack.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ export default async function createCompiler (dir, { hotReload = false } = {}) {
5757
test: /\.js$/,
5858
loader: 'emit-file-loader',
5959
include: [dir, nextPagesDir],
60-
exclude: /node_modules/,
60+
exclude (str) {
61+
return /node_modules/.test(str) && str.indexOf(nextPagesDir) !== 0
62+
},
6163
query: {
6264
name: 'dist/[path][name].[ext]'
6365
}
@@ -71,7 +73,9 @@ export default async function createCompiler (dir, { hotReload = false } = {}) {
7173
test: /\.js$/,
7274
loader: 'babel',
7375
include: [dir, nextPagesDir],
74-
exclude: /node_modules/,
76+
exclude (str) {
77+
return /node_modules/.test(str) && str.indexOf(nextPagesDir) !== 0
78+
},
7579
query: {
7680
presets: ['es2015', 'react'],
7781
plugins: [

0 commit comments

Comments
 (0)