g6/.storybook/webpack.config.js
2020-02-14 11:30:12 +08:00

41 lines
932 B
JavaScript

const resolve = require('path').resolve;
module.exports = ({ config }) => {
config.module.rules.push({
test: /\.(ts|tsx)$/,
loader: require.resolve('awesome-typescript-loader'),
});
config.module.rules.push(
{
test: /\.stories\.tsx?$/,
// loaders: [
// {
// loader: require.resolve('@storybook/addon-storysource/loader'),
// options: { parser: 'typescript' },
// },
// ],
use: {
loader: 'ts-loader',
options: {
transpileOnly: true,
},
},
enforce: 'pre',
// include: [
// path.resolve(__dirname, "./src"),
// path.resolve(__dirname, "./demos")
// ],
exclude: /node_modules | tests/,
},
// {
// test: /\.stories\.css?$/,
// use: ['style-loader', 'css-loader'],
// },
);
config.resolve.extensions.push('.ts', '.tsx', '.js');
return config;
};