【发布时间】:2016-08-03 18:42:48
【问题描述】:
我已经构建了一个 Aurelia 应用程序,但我不确定需要将什么推送到生产服务器。我已经阅读了 Node 并且开始更多地掌握它。如果我们只是推送dist文件夹(捆绑文件夹)、index.html、package.json,服务器会自动使用json文件拉取合适的包吗?还是我们必须在服务器的 CLI 上运行 npm install 才能下载这些包?如果我们必须这样做,那么我假设我们必须对 jspm 做同样的事情。
另外,连同 json 文件,我们是否需要将 config.js 推送到生产环境?
编辑
我刚刚运行 gulp export,它会生成一个导出文件夹,其中包含以下内容:
- dist 文件夹
- jspm_packages 文件夹
- config.js
- index.html
- favicon.ico
我复制所有这些文件并将它们投入生产。第一个错误我在 main.js 上得到了 404
这是我的 bundles.js 文件
module.exports = {
"bundles": {
"dist/app-build": {
"includes": [
"[**/*.js]",
"**/*.html!text",
"**/*.css!text"
],
"options": {
"inject": true,
"minify": true,
"depCache": true,
"rev": false
}
},
"dist/aurelia": {
"includes": [
"aurelia-framework",
"aurelia-bootstrapper",
"aurelia-fetch-client",
"aurelia-router",
"aurelia-animator-css",
"aurelia-templating-binding",
"aurelia-polyfills",
"aurelia-templating-resources",
"aurelia-templating-router",
"aurelia-loader-default",
"aurelia-history-browser",
"aurelia-logging-console",
"bootstrap",
"bootstrap/css/bootstrap.css!text",
"fetch",
"jquery"
],
"options": {
"inject": true,
"minify": true,
"depCache": false,
"rev": false
}
}
}
};
我很困惑为什么它没有加载我的 nprogress 栏。我得到了 404,它正在搜索 appName/jspm_packages/github/rstacruz-nprogress。为什么它不自动将其配置为捆绑/导出?如何将其修复为自动包含我引入的所有库的位置?
【问题讨论】:
标签: json node.js web-deployment aurelia