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$/,
|
test: /\.js$/,
|
||||||
loader: 'emit-file-loader',
|
loader: 'emit-file-loader',
|
||||||
include: [dir, nextPagesDir],
|
include: [dir, nextPagesDir],
|
||||||
exclude: /node_modules/,
|
exclude (str) {
|
||||||
|
return /node_modules/.test(str) && str.indexOf(nextPagesDir) !== 0
|
||||||
|
},
|
||||||
query: {
|
query: {
|
||||||
name: 'dist/[path][name].[ext]'
|
name: 'dist/[path][name].[ext]'
|
||||||
}
|
}
|
||||||
|
@ -71,7 +73,9 @@ export default async function createCompiler (dir, { hotReload = false } = {}) {
|
||||||
test: /\.js$/,
|
test: /\.js$/,
|
||||||
loader: 'babel',
|
loader: 'babel',
|
||||||
include: [dir, nextPagesDir],
|
include: [dir, nextPagesDir],
|
||||||
exclude: /node_modules/,
|
exclude (str) {
|
||||||
|
return /node_modules/.test(str) && str.indexOf(nextPagesDir) !== 0
|
||||||
|
},
|
||||||
query: {
|
query: {
|
||||||
presets: ['es2015', 'react'],
|
presets: ['es2015', 'react'],
|
||||||
plugins: [
|
plugins: [
|
||||||
|
|
Loading…
Reference in a new issue