2017-08-17 2 views
0

こんにちは私はAureliaのCLI上に構築されたWebアプリケーションを持っています。 (私がhereに対処した)パフォーマンスの問題を解決するために、最新のバージョンのAurelia(パフォーマンスの問題を修正した0.30.1)に更新しました。そうするために、私は、最新バージョンにsemverを強制的に利用できる、他のNPMのパッケージをアップデートする必要がありましたNPM-チェック - アップデートパッケージを使用して、最初生産のためのAureliaビルドは、 "undefined"という内容のバンドルを作成します

npm install -g npm-check-updates 
ncu --upgrade 
npm update 
npm install babel-runtime --save-dev 
npm install timers-ext --save-dev 
npm install gulp-sourcemaps --save-dev 
npm install aurelia-pal --save-dev 
npm install aurelia-binding --save-dev 
npm install aurelia-templating --save-dev 

これは

{ 
"name": "XX.YY.Web", 
    "type": "project:application", 
    "platform": { 
    "id": "web", 
    "displayName": "Web", 
    "output": "scripts", 
    "index": "index.html" 
    }, 
    "transpiler": { 
    "id": "babel", 
    "displayName": "Babel", 
    "fileExtension": ".js", 
    "options": { 
     "plugins": [ 
     "transform-es2015-modules-amd" 
     ] 
    }, 
    "source": "src\\**\\*.js" 
    }, 
    "markupProcessor": { 
    "id": "none", 
    "displayName": "None", 
    "fileExtension": ".html", 
    "source": "src\\**\\*.html" 
    }, 
    "cssProcessor": { 
    "id": "none", 
    "displayName": "None", 
    "fileExtension": ".css", 
    "source": "src\\**\\*.css" 
    }, 
    "editor": { 
    "id": "vscode", 
    "displayName": "Visual Studio Code" 
    }, 
    "unitTestRunner": { 
    "id": "karma", 
    "displayName": "Karma", 
    "source": "test\\unit\\**\\*.js" 
    }, 
    "paths": { 
    "root": "src" 
    }, 
    "testFramework": { 
    "id": "jasmine", 
    "displayName": "Jasmine" 
    }, 
    "build": { 
    "targets": [ 
     { 
     "id": "web", 
     "displayName": "Web", 
     "output": "scripts", 
     "index": "scripts/index.html", 
     "useAbsolutePath": true 
     } 
    ], 
    "loader": { 
     "type": "require", 
     "configTarget": "vendor-bundle.js", 
     "includeBundleMetadataInConfig": "auto", 
     "config": { 
     "waitSeconds": 0, 
     "paths": { 
      "jquery": "../scripts/lib/cdn/jquery-3.1.0.min", 
      "breeze-client": "../node_modules/breeze-client/breeze.debug" 
     } 
     }, 
     "plugins": [ 
     { 
      "name": "text", 
      "extensions": [ 
      ".html", 
      ".css" 
      ], 
      "stub": true 
     } 
     ] 
    }, 
    "options": { 
     "minify": "stage & prod", 
     "sourcemaps": "dev & stage", 
     "rev": "stage & prod" 
    }, 
    "bundles": [ 
     { 
     "name": "app-bundle.js",   
     "source": [ 
      "[**/*.js]", 
      "**/*.{css,html}" 
     ] 
     }, 
     { 
     "name": "vendor-bundle.js", 
     "prepend": [ 
      "node_modules/bluebird/js/browser/bluebird.core.js",   
      "scripts/lib/require.js" 
     ], 
     "dependencies": [ 
      "aurelia-binding", 
      "aurelia-bootstrapper", 
      "aurelia-dependency-injection", 
      "aurelia-event-aggregator", 
      "aurelia-fetch-client", 
      "aurelia-framework", 
      "aurelia-history", 
      "aurelia-history-browser", 
      "aurelia-loader", 
      "aurelia-loader-default", 
      "aurelia-logging", 
      "aurelia-logging-console", 
      "aurelia-metadata", 
      "aurelia-pal", 
      "aurelia-pal-browser", 
      "aurelia-path", 
      "aurelia-polyfills", 
      "aurelia-route-recognizer", 
      "aurelia-router", 
      "aurelia-task-queue", 
      "aurelia-templating", 
      "aurelia-templating-binding", 
      { 
      "name": "text", 
      "path": "../scripts/lib/text", 
      "packageRoot": "../scripts/lib" 
      }, 
      { 
      "name": "aurelia-templating-resources", 
      "path": "../node_modules/aurelia-templating-resources/dist/amd", 
      "main": "aurelia-templating-resources" 
      }, 
      { 
      "name": "aurelia-templating-router", 
      "path": "../node_modules/aurelia-templating-router/dist/amd", 
      "main": "aurelia-templating-router" 
      }, 
      { 
      "name": "aurelia-breeze", 
      "path": "../node_modules/aurelia-breeze/dist/amd", 
      "main": "aurelia-breeze" 
      }, 
      { 
      "name": "breeze-client", 
      "path": "../node_modules/breeze-client", 
      "main": "breeze.debug" 
      }, 
      { 
      "name": "whatwg-fetch", 
      "path": "../node_modules/whatwg-fetch", 
      "main": "fetch" 
      }, 
      { 
      "name": "aurelia-testing", 
      "path": "../node_modules/aurelia-testing/dist/amd", 
      "main": "aurelia-testing", 
      "env": "dev" 
      }, 
      { 
      "name": "icheck", 
      "path": "../node_modules/icheck", 
      "main": "icheck.min" 
      }, 
      { 
      "name": "filesaver.js", 
      "path": "../node_modules/filesaver.js", 
      "main": "FileSaver.min" 
      } 
     ] 
     } 
    ] 
    } 
} 

私aurelia.jsonファイルです私は今問題があります。私は

au build 

または

au run –watch 

を実行する場合、私は何の問題もありません。 私は

au build –env prod 

は、APP-とベンダーbundle- [識別子] .jsファイルを作成するために、私はすべてのエラーを得ることはありません実行されますが、両方のファイルがいうだけで空の作成終わる場合、または「定義されていない "。

Node.jsのバージョン:6.11.2(現在の最新の安定版)

NPMバージョン:3.10.10

誰もがアイデアを持っていますか?それはminificationメカニズム(devには起こらない)と関係がありますか?

何がうまくいかないのですか?

UPDATE:aurelia.jsonファイル内のdevの環境のためにも

私がアクティブ化したにより縮小が、これは私が、私はdevに関する縮小を有効にした場合

Failed to write the bundle 
SyntaxError: Unexpected token u in JSON at position 0 
    at Object.parse (native) 
    at new Converter (E:\Code\Application\XX-dev\XX.YY.Web\node_modules\aurelia-cli\lib\build\convert-source-map\index.js:42:48) 
    at Object.exports.fromJSON (E:\Code\Application\XX-dev\XX.YY.Web\node_modules\aurelia-cli\lib\build\convert-source-map\index.js:96:10) 
    at work.then (E:\Code\Application\XX-dev\XX.YY.Web\node_modules\aurelia-cli\lib\build\bundle.js:259:48) 
    at process._tickDomainCallback (internal/process/next_tick.js:135:7) 
{ uid: 8, 
    name: 'writeBundles', 
    branch: false, 
    error: 
    SyntaxError: Unexpected token u in JSON at position 0 
     at Object.parse (native) 
     at new Converter (E:\Code\Application\XX-dev\XX.YY.Web\node_modules\aurelia-cli\lib\build\convert-source-map\index.js:42:48) 
     at Object.exports.fromJSON (E:\Code\Application\XX-dev\XX.YY.Web\node_modules\aurelia-cli\lib\build\convert-source-map\index.js:96:10) 
     at work.then (E:\Code\Application\XX-dev\XX.YY.Web\node_modules\aurelia-cli\lib\build\bundle.js:259:48) 
     at process._tickDomainCallback (internal/process/next_tick.js:135:7), 
    duration: [ 5, 639721541 ], 
    time: 1502969144275 } 
{ uid: 0, 
    name: '<series>', 
    branch: true, 
    error: 
    SyntaxError: Unexpected token u in JSON at position 0 
     at Object.parse (native) 
     at new Converter (E:\Code\Application\XX-dev\XX.YY.Web\node_modules\aurelia-cli\lib\build\convert-source-map\index.js:42:48) 
     at Object.exports.fromJSON (E:\Code\Application\XX-dev\XX.YY.Web\node_modules\aurelia-cli\lib\build\convert-source-map\index.js:96:10) 
     at work.then (E:\Code\Application\XX-dev\XX.YY.Web\node_modules\aurelia-cli\lib\build\bundle.js:259:48) 
     at process._tickDomainCallback (internal/process/next_tick.js:135:7), 
    duration: [ 47, 444524559 ], 
    time: 1502969144277 } 
SyntaxError: Unexpected token u in JSON at position 0 
    at Object.parse (native) 
    at new Converter (E:\Code\Application\XX-dev\XX.YY.Web\node_modules\aurelia-cli\lib\build\convert-source-map\index.js:42:48) 
    at Object.exports.fromJSON (E:\Code\Application\XX-dev\XX.YY.Web\node_modules\aurelia-cli\lib\build\convert-source-map\index.js:96:10) 
    at work.then (E:\Code\Application\XX-dev\XX.YY.Web\node_modules\aurelia-cli\lib\build\bundle.js:259:48) 
    at process._tickDomainCallback (internal/process/next_tick.js:135:7) 

が、それは動作しません得たものですいずれか、私は上記の貼り付けエラーを与えます。また、ソースマップを削除しても、両方のバンドルでは定義されていませんが、エラーメッセージは表示されません。私はあなたが今だけ--env prodフラグなし(au buildを行うことができると思います。

答えて

0

アップグレードアウレリア-cliのNPMモジュール(0.31.3)の最新バージョンおよび他のすべてのモジュールに彼らの最新バージョンに

0

は、問題を修正しました

+0

ヒントはありませんが、問題はプロダクトのみで発生します。私はそれを小さくしても発生しないと思うのですが、デベロッパーの方もオンにしても動作しません。 –

+0

申し訳ありませんが、それはちょうど推測だったので、答えではなくコメントとして。 – LStarky

関連する問題