简体   繁体   English

使用dart2js构建非最小化的项目

[英]Build a non minimized project with dart2js

Have a project builds and runs with webdev serve ok. 使用webdev serve构建并运行一个项目即可。 With webdev build it builds and deploy fine, but crashes when loading in the browser. 使用webdev build可以很好地构建和部署,但是在浏览器中加载时会崩溃。 In order to do better debugging I would like a non-minimized build, but got hit by some other error. 为了进行更好的调试,我希望使用非最小化的版本,但是遇到其他错误。

Have now backed to a unmodified standard boilerplate project from the dart-sdk and same error, see below. 现在已经从dart-sdk返回到未经修改的标准样板项目,并且出现了相同的错误,请参见下文。

With dart-sdk 2.1.0-dev.4.0, creating the a project from the template. 使用dart-sdk 2.1.0-dev.4.0,通过模板创建一个项目。

"description: An absolute bare-bones web app." “描述:绝对的准系统Web应用程序。”

webdev serve builds and run fine. webdev serve构建并运行良好。 webdev build Also builds and run fine. webdev build还可以构建并正常运行。

For webdev build --no-release The project builds, but when loaded got 对于webdev build --no-release项目可以构建,但是在加载时得到了

main.dart.js:64 GET http://localhost/packages/build_web_compilers/src/dev_compiler_stack_trace/stack_trace_mapper.dart.js net::ERR_ABORTED 404 (Not Found)
(anonymous) @ main.dart.js:64
(anonymous) @ main.dart.js:81
main.dart.js:71 GET http://localhost/packages/$sdk/dev_compiler/amd/require.js net::ERR_ABORTED 404 (Not Found)
(anonymous) @ main.dart.js:71
(anonymous) @ main.dart.js:81

Is the --no-release used wrong, should the environment be different, are there other ways to build a non-minimized build? --no-release使用是否错误,环境应该不同吗,还有其他方法来构建非最小化版本吗?

Found a simple temporary workaround, that seems to do the trick. 找到了一个简单的临时解决方法,似乎可以解决问题。

First deploy with 首先部署

webdev build -o builddir

Then overwrite generated main.dart.js with 然后用覆盖生成的main.dart.js

dart2js -o builddir/web/main.dart.js web/main.dart

Apart from the source mappings aren't setup correct in my environment it seems to work correct. 除了源映射在我的环境中设置不正确外,它似乎工作正常。

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

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