提交 ba2e2ace 编写于 作者: N nkzawa

webpack: fix loader exclude settings

上级 becae903
......@@ -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: [
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册