Webapp Output Target: www
The www output target type is oriented for webapps and websites, hosted from an http server, which can benefit from prerendering and service workers, such as this very site you're reading. For a walkthrough, see Using Stencil for an Application.
Even if a project is meant to only build a reusable component library, the www output target is useful to build out and test the components throughout development.
outputTargets: [
{
type: 'www'
}
]
構成
| プロパティ | 説明 | デフォルト値 |
|---|---|---|
baseUrl | baseUrlは、提供されるサイトの「ベ ース」URLを表します。たとえば、このサイトのベースURLは https://stenciljs.com/です。ただし、サイト全体の出力がサブディレクトリ内にある場合、このディレクトリのパスは baseUrlである必要があります。たとえば、Ionicのドキュメントは、 https://ionicframework.com/内の /docsディレクトリにあるスタンドアロンのステンシルサイトです。この例では、 https://ionicframework.com/docs/がベースURLになります。 | / |
buildDir | The buildDir is the directory of Stencil's generated scripts, such as the component files. | build |
bundleMode | Chooses how components are bundled for this output. 'loader' uses the loader-bundle architecture: chunk-split, loaded lazily via a loader script. 'standalone' uses one module per component with an auto-loader instead - simpler, easier to debug. Defaults to 'standalone' only if a standalone output target is configured and no loader-bundle is; otherwise defaults to 'loader'. | 'loader' (auto-detected) |
copy | An array of copy tasks to run during the build, in addition to the assets/manifest.json files Stencil already copies automatically. | undefined |
dir | dir設定は、パブリックWeb配布ディレクトリを指定します。このディレクトリは通常、静的ファイルの提供など、提供されるアプリのルート ディレクトリです。このディレクトリは、ソースファイルから直接ビルドおよび再ビルドされます。さらに、これはビルドターゲットであるため、ビルドのたびにすべてのファイルが削除および再ビルドされるため、常にソースファイルをこのディレクトリにコピーすることをお勧めします。このディレクトリはリポジトリにコミットしないことをお勧めします。 | www |
empty | デフォルトでは、各ビルドの前に、 dirディレクトリからすべてのファイルが空になります。ただし、このディレクトリが空にならないようにするには、この値を「false」に変更します。 | true |
hashedFileNameLength | Number of characters to use for the content hash in filenames, when hashFileNames is enabled. | 8 |
hashFileNames | Hash the filenames of generated chunks based on their content, enabling forever-caching of CDN-served bundles. | true in production, false in dev |
indexHtml | indexHtmlプロパティは、ルートインデックスhtmlファイルの場所を表します。 | index.html |
prerenderConfig | Path to a module exporting prerender hooks (beforeSsr, afterSsr) run against each prerendered page. See Prerender Config. | undefined |
serviceWorker | Service worker config for production builds - null by default, so nothing is generated unless you opt in. Set to true to generate one with default settings, or provide a config object to customize it; any values you provide override Stencil's defaults, per the Workbox documentation. In development mode, a script that deregisters any existing service worker is always injected instead. | null (disabled) |
skipInDev | Not read by the www output target - this output always runs, in dev and production alike, regardless of this setting. | n/a |