1
0
Fork 0
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:
nkzawa 2016-10-25 18:11:39 +09:00
parent becae90375
commit ba2e2aced9

View file

@ -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: [