g6/.storybook/webpack.config.js

45 lines
1005 B
JavaScript
Raw Normal View History

2019-12-31 12:56:28 +08:00
const resolve = require('path').resolve;
2019-12-31 12:56:28 +08:00
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');
2019-12-31 12:56:28 +08:00
config.resolve.alias = {
'@g6/types': resolve(process.cwd(), './types'),
'@g6': resolve(process.cwd(), './src')
}
return config;
};