Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

browserify / watchify導入 #31

Merged
merged 2 commits into from
Jun 5, 2016
Merged

browserify / watchify導入 #31

merged 2 commits into from
Jun 5, 2016

Conversation

shokai
Copy link
Collaborator

@shokai shokai commented Jun 4, 2016

#28 関係

先に #30 のmerge前提で

コマンド

  • 開発時は npm run watch で継続的にsourcemap付きでbrowserify
  • デプロイ前にnpm run build で圧縮してbrowserify
  • gulpは npm run gulp に移動した

READMEも更新した

browserify / watchify導入

  • src/index.jsdist/index.js にコンパイルする
  • sourceMapが付いたので、ブラウザの開発パネルでソースのエラー行が見える
  • 開発時はwatchifyを使う
  • jqueryとsocket.io-clientをbundleした
  • id:switch_menuのdivからswitchMenu関数を読んでる部分をindex.jsに移動した
    • browserifyで固めた中の関数はHTMLから参照できない為
  • なぜかlindaをimportするとwsの中でbufferutilとutf-8-validateを探しに行ってビルドできない
    • とりあえずlindaだけscriptタグで読み込む事にした

gulpfile修正

  • babelを外した
  • dist/*.js が更新されたらリロードされる

不要なもの削除

socket.io.jsはnpmから入れるので削除した
その他不要になったnpmをいくつか削除

shokai added 2 commits June 5, 2016 05:13
- src/index.js を dist/index.js にコンパイルする
- sourceMapが付いたので、ブラウザの開発パネルでソースのエラー行が見える
- 開発時はwatchifyを使う
- jqueryとsocket.io-clientをbundleした
- id:switch_menuのdivからswitchMenu関数を読んでる部分をindex.jsに移動した
  - browserifyで固めた中の関数はHTMLから参照できない為
- なぜかlindaをimportするとwsの中でbufferutilとutf-8-validateを探しに行ってビルドできないので、lindaだけscriptタグで読み込む

gulpfile修正
- babelを外した
- dist/*.js が更新されたらリロード
@shokai shokai changed the title [WIP] browserify / watchify導入 browserify / watchify導入 Jun 4, 2016
@shokai
Copy link
Collaborator Author

shokai commented Jun 4, 2016

リファクタリングしようかと思ったけど力尽きた

とりあえずこれでファイル分割ができるようになったので、「fromArrayの中を見てgridの中に書く部品」という単位でパーツを分割するといいかもしれない
できるのかな、たぶんできる・・

@napo0703 napo0703 merged commit b091902 into napo0703:master Jun 5, 2016
@napo0703
Copy link
Owner

napo0703 commented Jun 5, 2016

@shokai shokai mentioned this pull request Jun 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants