lyfeyaj / qn-webpack

Qiniu webpack plugin (七牛 Webpack 插件)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

include & exclude 无法正常工作

kangfenmao opened this issue · comments

配置如下:

new QiniuPlugin({
    accessKey: 'xxxxxxxxxxxxxxxxxxxx',
    secretKey: 'xxxxxxxxxxxxxxxxxxxx',
    bucket: 'dsxqian-dev',
    path: 'dist/[hash:8]/',
    include: '/(app\.js|app\.css)$/'
}),

但是结果还是所有文件都被上传了
我来到qn-webpack index.js进行调试,输出配置文件结果是这样的:

//Check included files
if (
    this.options.include &&
    this.options.include instanceof RegExp
) {
    return this.options.include.test(fileName);
}

this.options.include instanceof RegExp 不通过

于是我在前面输出了一下this.options.include结果是这样的
项目最终输出的是4个文件,每个文件对应的include是这样的,第一个有问题:

pp.css)&/
/(app\.js|app\.css)$/
/(app\.js|app\.css)$/
/(app\.js|app\.css)$/

try qn-webpack@1.0.4