メインコンテンツまでスキップ
バージョン: v4.41

Plugins

Stencil plugins​

By default, Stencil does not come with Sass or PostCSS support. However, either can be added using the plugins array.

import { Config } from '@stencil/core';
import { sass } from '@stencil/sass';

export const config: Config = {
plugins: [
sass()
]
};

Rollup plugins​

rollupPlugins構成を使用して、独自のRollupプラグインを追加できます。 内部的には、ステンシルには node-resolveやcommonjsなどの組み込みプラグインが付属しています。ロールアッププラグインの実行順序が重要であるため、ステンシルはノード解決の前と*commonjs変換**の後にカスタムプラグインを挿入するAPIを提供します。

export const config = {
rollupPlugins: {
before: [
// rollupNodeResolve()の前に挿入されたプラグイン
resolvePlugin()
],
after: [
// commonjs()の後に挿入されたプラグイン
nodePolyfills()
]
}
}

Nodeポリフィル​

See the Node Polyfills in Module bundling for other examples.