Taro编译配置H5如何ignore掉部分.js文件



  • 我们知道编译选项中,weapp可以配置

    compile: {
        exclude: ['./ec-canvas/echarts.js'],
    }
    

    从而不走babel编译

    但针对H5似乎没有这个选项
    尝试过在plugins.babel中配置excludeignore
    提示

    Module build failed (from ./node_modules/babel-loader/lib/index.js):
    ReferenceError: [BABEL] /***/.temp/app.js: Unknown option: base.exclude. Check out http://babeljs.io/docs/usage/options/ for more information about options.
    
    A common cause of this error is the presence of a configuration options object without the corresponding preset name. Example:
    

    然而babel7中的options是支持exclude

    所以我想请教下,应该如何做才能使babel忽略一些文件的编译呢


登录后回复