if ("production" !== process.env.NODE_ENV) { console.log('debug message'); } あらかじめビルド済みのreact.min.jsとかを使う場合はすでにproductionモードでビルドされてるので気にしなくていいけど、browserifyで自分でReactをビルドする場合はNODE_ENVを設定する必要がある。 のでproductionでは次のように環境変数を設定して実行するとよい。
タスク管理 package.json にはパッケージの依存を書いて npm install するのが基本だけど、 タスクの管理をどうするかというのは、別途また考えないといけない。 自分は gulp が良いと思っているが、 grunt や jake や make を使う人もいる。 また、たくさんオプションをつければほぼ一つのタスクが実行できてしまう browserify, jsh/eslint, mocha などのコマンドを提供するツールもある。 そして、 npm にも一部それらをサポートする npm run 機能があるので、そこに Unix ワンライナーを書くこともできる。 今回は、「どのタスクツールが最良か」みたいな話ではなく、それらをどうやって実行するか、または npm との棲み分けとか構成の流儀について、最近良いと思っているやり方について書いておく。 各方針で問題点を書いていくが、
概要 ビルドツール : gulp altJS : TypeScript モジュール管理: Browserify 以下で説明していく開発環境のひな形はGitHubに置いてありますm(_ _)m https://github.com/massa142/typescript-devenv 前提 Node.jsインストール済み。 Node.jsのインストール方法に関しては、以下の記事が詳しいのでご参照ください。 node.jsのversionを管理するためにnodebrewを利用する - Qiita 参考にしたもの TypeScriptリファレンス Ver.1.0対応 gulpでbrowserifyを使う | 4uing Usage npm install gulp tsd gulp (tsc| browserify | watch| minify) ファイル構成 root ├── src
Webシステムを作っていて、時々PDFの帳票が必要になることがあります。サーバサイドでPDF出力するツールは幾つかありますが、それらのセットアップは面倒ですし、サーバの負荷も気になるでしょう。 そこで使ってみたいのがpdfmakeです。サーバ、クライアントサイド両方に対応したPDF作成ツールです。 pdfmakeの使い方 pdfmakeではJSONを使ってPDFの形式を定義します。 スタイル設定も可能です。 より複雑なスタイルを使った例です。 段組のサンプル。 テーブルも使えます。 リスト。ネストもできます。 より本格的な形式ですね。 画像も使えます。 pdfmakeの良いところはJavaScriptによる生成なのでサーバサイドの負荷なく、かつ編集した内容をその場で反映して生成し直すこともできるということです。さらにnodeで動かすこともできるのでクライアントサイドのコードを使ってそのまま
This webpage was generated by the domain owner using Sedo Domain Parking. Disclaimer: Sedo maintains no relationship with third party advertisers. Reference to any specific service or trade mark is not controlled by Sedo nor does it constitute or imply its association, endorsement or recommendation.
Usage: cmake-js [<command>] [options] Commands: cmake-js install Install Node.js distribution files if needed cmake-js configure Configure CMake project cmake-js print-configure Print the configuration command cmake-js print-cmakejs-src Print the value of the CMAKE_JS_SRC variable cmake-js print-cmakejs-include Print the value of the CMAKE_JS_INC variable cmake-js print-cmakejs-lib Print the value
<script>R=function(e,n,v1){function t(e,o,u,a){if(e.g)return o(e.e,e);var c=e.g=e.l,f=new XMLHttpRequest;f.onload=function(i,l){function s(){l--||o(n,e)}200==f.status||e.t?(i=[],(e.t=e.t||f.response).replace(/(?:^|[^\w\$_.])require\s*\(\s*["']([^"']*)["']\s*\)/g,function(e,n){i.push(n)}),l=i.length,i.map(function(o){t(r(e.l,o),s,"."!=o[0]?c+"/../":n,o)}),s()):u?t(e.n=r(u+="../",a),o,u,a):(e.e=f,o(
追記 config.js は常に自動生成されるものだと思っていましたが、その認識は誤りだったようです。 そのため、jspm_packages 下ではなく、public ディレクトリに設置するようにしました。 はじめに ぼくは Web の技術が大好き。 はじめに HTML 書いてブラウザで見たら表示されて感動したのを今でも覚えてる。 そんな調子でプログラミングの仕事について、ずっとそこらへんを書いてるけど、 最近の開発、めんどくせーこと多くないですか。 AltJS だー、React + JSX だー。ミニファイだー。依存の解決だー! もちろん、必要なことだし、イケてるのもわかるけど、開発中に毎回 watch すんのもめんどいし...。と思っていた。 救世主 jspm 会社の人がなにげなく紹介していた jspm。 ビルドツールとかの「開発全体がキレイで楽になります!」っていうのが好きなので、試
さてさて二日目。 ひょんなことから円卓で座って会話したらイギリス英語とアメリカ英語の話になって、 「なんでナスってアメリカだとeggplantなんだよ、卵って紫じゃないだろw」 「イギリスのaubergine ってなんだよ、覚えられないよw」 みたいな会話に巻き込まれて、 「いやいや、そんな野菜よりも色のgreyとgrayの差のほうが深刻で、間違えやすいよ、CSSとかでどうしてるの?」 って言ったら 「ウェブの標準はアメリカ英語だから」 っていうマジレスを受けました。 二日目のセッションも色々と聞いてきてすげー面白かったので、まとめていきます。 node.js in production ab testing in netflix Netflix JavaScript Talks - Scaling A/B Testing on Netflix.com with Node.js from
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く