LoginSignup
1
0

More than 3 years have passed since last update.

Parcelを使う時にハマったpackage.jsonのscripts

Posted at

ParcelでPug + Stylus + TypeScriptの環境構築をやっていました。

複数ディレクトリに対応させるためには、
以下のようなスクリプトをpackage.jsonに入れると便利です。

package.json
  "scripts": {
    "dev": "parcel \"pug/**/!(_)*.pug\"",
    "watch": "parcel watch \"pug/**/!(_)*.pug\"",
    "build": "parcel build \"pug/**/!(_)*.pug\""
  },

なぜ\"を挟んでいるかというと!が特殊文字で想定と違う挙動をしてエラーが出てしまうので\"で囲んで文字列にしています。

1
0
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
0