欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

javascript - 关于grunt插件browserify配置问题,求助

程序员文章站 2022-05-04 20:35:37
...
 browserify: {
      options: {
        transform: ['brfs'],
        debug: true
      },
      debug: {
        files: {'build/test.min.js': 'src/test.js'},  
      }
    }
    

只要加了transform: ['brfs'],就会报错,去掉就能正常编译,什么情况啊?

$ grunt
Running "browserify:debug" (browserify) task
>> TypeError: Cannot read property 'apply' of undefined while parsing file: X:\Users\javascript\Desktop\LEARN\learn_grunt\src\test.js
Warning: Error running grunt-browserify. Use --force to continue.

Aborted due to warnings.

回复内容:

 browserify: {
      options: {
        transform: ['brfs'],
        debug: true
      },
      debug: {
        files: {'build/test.min.js': 'src/test.js'},  
      }
    }
    

只要加了transform: ['brfs'],就会报错,去掉就能正常编译,什么情况啊?

$ grunt
Running "browserify:debug" (browserify) task
>> TypeError: Cannot read property 'apply' of undefined while parsing file: X:\Users\javascript\Desktop\LEARN\learn_grunt\src\test.js
Warning: Error running grunt-browserify. Use --force to continue.

Aborted due to warnings.