【发布时间】:2018-06-28 05:22:51
【问题描述】:
我正在尝试使用 webpack 来捆绑我的 Nativescript 应用程序,但我遇到了一些问题。
第一个问题是运行以下命令:
tns build android --bundle
当我这样做时,我相当肯定 webpack 没有发生任何事情。我看到了这个输出:
Executing before-prepare hook from F:\workspace\myproject\hooks\before-
prepare\nativescript-dev-sass.js
Executing before-prepare hook from F:\workspace\myproject\hooks\before-
prepare\nativescript-dev-typescript.js
Preparing project...
Project successfully prepared (android)
Executing after-prepare hook from F:\workspace\myproject\hooks\after-
prepare\nativescript-dev-sass.js
All SASS source files removed from app package
Executing after-prepare hook from F:\workspace\myproject\hooks\after-
prepare\nativescript-dev-webpack.js
Executing after-prepare hook from F:\workspace\myproject\hooks\after-
prepare\nativescript-unit-test-runner.js
Building project...
Gradle build...
没有错误,但是 nativescript-dev-webpack before-prepare 钩子没有被调用。我的项目中有一个带有 nativescript-dev-webpack.js 文件的 before-prepareJSApp 文件夹,但由于某种原因它没有被调用。
另一个可能相关的问题是当我尝试运行它时:
tns build android --bundle --env.aot --env.uglify --env.snapshot
输出很简单:
The option 'env' is not supported. To see command's options, use '$ tns help build'. To see all commands use '$ tns help'.
我有什么遗漏吗?谢谢!
【问题讨论】:
标签: angular webpack nativescript