想要排除webpack的loader中,一些文件夹不需要处理:
{
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
loader: 'url',
include: [path.resolve(__dirname, '../src/st')],
exclude: [path.resolve(__dirname, '../src/st/img/ex')],
query: {
limit: 10000,
name: utils.assetsPath('img/[name].[hash:7].[ext]')
}
},
编译报错:You may need an appropriate loader to handle this file type.
只要把:exclude: [path.resolve(__dirname, '../src/st/img/ex')],这个注销,就能够正常。请问怎样才能排除不需要编译的文件夹。
比如你不想编译node_modules,直接排除就可以了