简体   繁体   English

Browserify + Grunt + Remapify:找不到模块

[英]Browserify + Grunt + Remapify: Cannot Find Module

I've read all the docs and several solutions here, but I can't seem to get Remapify configured properly in my Grunt-Browserify config. 我已经在这里阅读了所有文档和几种解决方案 ,但似乎无法在Grunt-Browserify配置中正确配置Remapify。

Here are two few variations I've tried, both resulting in the error "Cannot find module..." 这是我尝试过的两种变体,均导致错误“找不到模块...”

browserify: {

  options: {
    preBundleCB: function (b) {
      b.plugin(remapify, [{
        cwd: './dev/js/modules',
        src: './**/*.js',
        expose: 'modules'
      }]);
    }
  }
}


browserify: {

  options: {
    preBundleCB: function (b) {
      b.plugin(remapify, [{
        cwd: __dirname,
        src: '.dev/js/modules/**/*.js',
        expose: 'modules'
      }]);
    }
  }
}

Does anyone see what I'm doing wrong? 有人看到我在做什么错吗?

this should work for you 这应该为你工作

{
   cwd: './dev/js/modules',
   src: '**/*.js',
   expose: 'modules'
}

if expose is an empty string you'll have the same result, very usefull 如果暴露是一个空字符串,您将得到相同的结果,非常有用

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM