【问题标题】:Grunt Browserify max call stack size exceeded超出 Grunt Browserify 最大调用堆栈大小
【发布时间】:2015-04-26 12:09:12
【问题描述】:

我正在使用 grunt-browserify 来编译我的 react/flux 应用程序。我还在 browserify 选项下启用了 Watchify,以加快编译过程。它在第一次运行时编译良好,但是一旦我更改文件并再次编译,浏览器控制台中会出现Maximum Call Stack Size Exceeded 错误并破坏应用程序。

Watchify 似乎在重新编译时再次添加了 react/flux/other 依赖项,这会导致错误。只是一个理论。

有什么想法吗?

咕噜任务

browserify: {
  dist: {
    files: {
      'public/dist/bundle.js': ['public/js/**/*.jsx', 'public/js/**/*.js']
    },
    options: {
      debug: true,
      bare: true,
      alias: [
        './node_modules/react/dist/react-with-addons.js:react',
        './node_modules/flux/index.js:flux',
        './public/lib/react-router/react-router.js:react-router',
        './node_modules/lodash/index.js:lodash'
      ],
      transform: [react.browserify],
      watch: true,
      keepAlive: true
    }
  }
}

注册

grunt.registerTask('compile', ['browserify']);

【问题讨论】:

    标签: gruntjs reactjs browserify


    【解决方案1】:

    您是否尝试忽略“public/dist/bundle.js”进行观看?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-11-17
      • 1970-01-01
      • 1970-01-01
      • 2015-10-24
      • 2015-12-29
      • 2017-12-27
      • 2020-12-06
      • 1970-01-01
      相关资源
      最近更新 更多