{"id":21015000,"url":"https://github.com/simiraaaa/pug-builder","last_synced_at":"2025-10-05T12:32:52.809Z","repository":{"id":34243595,"uuid":"173244603","full_name":"simiraaaa/pug-builder","owner":"simiraaaa","description":"pug watch and build パグファイルを監視して自動でビルドする","archived":false,"fork":false,"pushed_at":"2022-12-03T00:26:25.000Z","size":130,"stargazers_count":1,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-12T01:04:30.753Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simiraaaa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-01T06:05:09.000Z","updated_at":"2021-04-14T07:57:18.000Z","dependencies_parsed_at":"2023-01-15T05:36:00.513Z","dependency_job_id":null,"html_url":"https://github.com/simiraaaa/pug-builder","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/simiraaaa/pug-builder","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simiraaaa%2Fpug-builder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simiraaaa%2Fpug-builder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simiraaaa%2Fpug-builder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simiraaaa%2Fpug-builder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simiraaaa","download_url":"https://codeload.github.com/simiraaaa/pug-builder/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simiraaaa%2Fpug-builder/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259374730,"owners_count":22847856,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-19T10:08:09.660Z","updated_at":"2025-10-05T12:32:47.777Z","avatar_url":"https://github.com/simiraaaa.png","language":"JavaScript","readme":"# pug-builder\n\npug to html\nbuild and watch\n\n1. npm を install\n2. 作業したいディレクトリへ移動\n3. `npm init -y` package.json 作成\n4. 開発用に pug-builder をインストール `npm i -D pug-builder`\n5. package.json の scripts に以下のコマンドを追加\n```\n  \"scripts\": {\n    \"build\": \"node ./dev/build.js\",\n    \"watch\": \"node ./dev/watch.js\"\n  },\n```\n6. 作業ディレクトリ(以下 wd) に dev フォルダ作成\n7. `wd/dev/build.js` と `wd/dev/watch.js` を作成\n8. build.js の中身を以下のように書く(パスはすべてwdからの相対パス)\n```\nvar builder = require('pug-builder');\nbuilder.build({\n  // pug ファイルを編集するディレクトリ\n  target: 'src',\n  // pug のモジュール(mixin等)のpugファイルを編集するディレクトリ(なければ指定する必要はない)\n  includes: 'includes',\n  // htmlを出力するディレクトリ (srcからの相対パスで出力)\n  output: 'dst',\n  // 出力するhtmlを読みやすくするかどうか\n  pretty: true,\n});\n```\n9. watch.js も以下のようにします\n```\nvar builder = require('pug-builder');\nbuilder.watch({\n  // pug ファイルを編集するディレクトリ\n  target: 'src',\n  // pug のモジュール(mixin等)のpugファイルを編集するディレクトリ(なければ指定する必要はない)\n  includes: 'includes',\n  // htmlを出力するディレクトリ (srcからの相対パスで出力)\n  output: 'dst',\n  // 出力するhtmlを読みやすくするかどうか\n  pretty: true,\n});\n```\n10. wd で `npm run build` と実行すると target で指定したディレクトリ内の pug ファイルがすべて html に変換され output で指定したディレクトリに出力されます\n11. `npm run watch` と実行すると target と includes で指定したディレクトリの編集を監視して自動でbuildを実行します。\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimiraaaa%2Fpug-builder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimiraaaa%2Fpug-builder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimiraaaa%2Fpug-builder/lists"}