mirror of
https://gitee.com/antv/g6.git
synced 2024-12-05 21:28:33 +08:00
41 lines
932 B
JavaScript
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;
|
|
};
|