为什么在构建电子应用程序时我的资产没有被移动?
Why aren't my assets being moved when building an electron app?
我已经开始使用 GitHub 的桌面应用程序框架 Electron 开发应用程序。我正在使用 Electron Boilerplate.
到 运行 应用我 运行 npm install
然后是 npm start
。这对初始样板非常有效。
我现在想整合jQuery。为此,我添加:
<script>
window.$ = window.jQuery = require('./assets/scripts/jquery-1.12.1.min.js');
</script>
不幸的是,这会在开发控制台中吐出一个错误,指出无法找到它。我假设所有 运行ning 来自 /build
目录,资产不在该目录中。
所以我的问题:
- 是否应将我的资产文件夹(
/assets/js
和 /assets/css
)中的资产复制到 npm start
/npm install
?
- 应用 运行ning 来自
/build
还是这里有其他问题?
谢谢
已修复!我不得不修改 /tasks/build/
中的 build.js
以包含我新创建的资产目录。
我已经开始使用 GitHub 的桌面应用程序框架 Electron 开发应用程序。我正在使用 Electron Boilerplate.
到 运行 应用我 运行 npm install
然后是 npm start
。这对初始样板非常有效。
我现在想整合jQuery。为此,我添加:
<script>
window.$ = window.jQuery = require('./assets/scripts/jquery-1.12.1.min.js');
</script>
不幸的是,这会在开发控制台中吐出一个错误,指出无法找到它。我假设所有 运行ning 来自 /build
目录,资产不在该目录中。
所以我的问题:
- 是否应将我的资产文件夹(
/assets/js
和/assets/css
)中的资产复制到npm start
/npm install
? - 应用 运行ning 来自
/build
还是这里有其他问题?
谢谢
已修复!我不得不修改 /tasks/build/
中的 build.js
以包含我新创建的资产目录。