Commit ba2e2ace authored by nkzawa's avatar nkzawa

webpack: fix loader exclude settings

parent becae903
...@@ -57,7 +57,9 @@ export default async function createCompiler (dir, { hotReload = false } = {}) { ...@@ -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 } = {}) { ...@@ -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: [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment