1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

SvelteでStorybookとsvelte-preprocessを使う方法

1
Posted at

TL;DR

.storybook/webpack.config.jsを、以下の内容で作成する。

const sveltePreprocess = require("svelte-preprocess");

module.exports = async ({ config, mode }) => {
  const svelteLoader = config.module.rules.find(r => r.loader && r.loader.includes("svelte-loader"));
  svelteLoader.options = {
    ...svelteLoader.options,
    preprocess: sveltePreprocess()
  };
  return config;
};

背景

このIssue記事が参考になりますが、少々古いせいか、そのままでは動きませんでした。

色々試していたら動いたので貼っておきます。

環境: Windows10 / Svelte / rollup / TypeScript

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?