LoginSignup
1
2

More than 5 years have passed since last update.

Parceljsをつかってみました。

Posted at

概要

こちらの記事をみかけて
確かにwebpackって設定ファイル書くのめんどくさいよね
ちょっと試してみよう
と思いました。

なので、ちょっとやってみた。

動くプログラム

https://github.com/taktod/parcelTest
手元
node v9.2.1
npm 5.6.0

で動作しました。
つかいかた

$ git clone https://github.com/taktod/parcelTest.git
$ cd parcelTest
$ npm install
$ npm test

あとは http://localhost:1234/
で適当なブラウザでアクセスすればOK

parcelをつかったプログラムの作り方

とっても簡単でした。

  1. 適当なnodeのプロジェクトを作る
  2. npm installでparcel-bundlerいれる
  3. index.htmlを適当に書く
  4. node_modules/.bin/parcel index.html でパッケージ化してhttpでアクセスできる状態にしてくれた

これだけ
typescriptを使いたい場合はtypescriptをnpm installでいれてindex.htmlで利用しているscriptタグのsrcをターゲットのtsファイルにするだけでした。

今後したいこと

AssetとPackagerというモジュールをつくるといろいろいじれるみたいなので
そっちを勉強してemscriptenでpackage化するときに自動的にコンパイルするコード書きたいなと思ってます。

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2