Disable uglyfying in r.js

∥☆過路亽.° 提交于 2019-12-03 05:54:47

Pass optimize=none on the command line to r.js, or include optimize: "none" in your build script.

eg:

({
    baseUrl: ".",
    paths: {
        jquery: "some/other/jquery"
    },
    name: "main",
    out: "main-built.js",
    optimize: "none"
})

See http://requirejs.org/docs/optimization.html for more information.

If you check the source, you will see that the default is set to "uglify". Here are the options which are accepted:

  • uglify: (default) uses UglifyJS to minify the code.
  • uglify2: in version 2.1.2+. Uses UglifyJS2.
  • closure: uses Google's Closure Compiler in simple optimization mode to minify the code. Only available if running the optimizer using Java.
  • closure.keepLines: Same as closure option, but keeps line returns in the minified files.
  • none: no minification will be performed.
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!