|
| 1 | +const path = require('path'); |
| 2 | +const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin'); |
| 3 | +const appConfig = require('../webpack.common'); |
| 4 | + |
| 5 | +module.exports = ({ config }) => { |
| 6 | + config.module.rules = []; |
| 7 | + config.module.rules.push(...appConfig.module.rules); |
| 8 | + config.module.rules.push({ |
| 9 | + test: /\.css$/, |
| 10 | + include: [ |
| 11 | + path.resolve(__dirname, '../src'), |
| 12 | + path.resolve(__dirname, '../node_modules/@storybook'), |
| 13 | + path.resolve(__dirname, '../node_modules/patternfly'), |
| 14 | + path.resolve(__dirname, '../node_modules/@patternfly/patternfly'), |
| 15 | + path.resolve(__dirname, '../node_modules/@patternfly/react-styles/css'), |
| 16 | + path.resolve(__dirname, '../node_modules/@patternfly/react-core/dist/styles/base.css'), |
| 17 | + path.resolve(__dirname, '../node_modules/@patternfly/react-core/dist/esm/@patternfly/patternfly'), |
| 18 | + path.resolve(__dirname, '../node_modules/@patternfly/react-core/node_modules/@patternfly/react-styles/css'), |
| 19 | + path.resolve(__dirname, '../node_modules/@patternfly/react-table/node_modules/@patternfly/react-styles/css'), |
| 20 | + path.resolve(__dirname, '../node_modules/@patternfly/react-inline-edit-extension/node_modules/@patternfly/react-styles/css') |
| 21 | + ], |
| 22 | + use: ["style-loader", "css-loader"] |
| 23 | + }); |
| 24 | + config.module.rules.push({ |
| 25 | + test: /\.tsx?$/, |
| 26 | + include: path.resolve(__dirname, '../src'), |
| 27 | + use: [ |
| 28 | + require.resolve('react-docgen-typescript-loader'), |
| 29 | + ], |
| 30 | + }) |
| 31 | + config.resolve.plugins = [ |
| 32 | + new TsconfigPathsPlugin({ |
| 33 | + configFile: path.resolve(__dirname, "../tsconfig.json") |
| 34 | + }) |
| 35 | + ]; |
| 36 | + config.resolve.extensions.push('.ts', '.tsx'); |
| 37 | + return config; |
| 38 | +}; |
0 commit comments