1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- const path = require('path')
- const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
- module.exports = ({ config }) => {
-
- const originalCssRuleIndex = config.module.rules.findIndex(rule => rule.test.source.includes('.css'));
- config.module.rules[originalCssRuleIndex] = {
- test: /\.(sa|sc|c)ss$/i,
- use: [
-
- 'style-loader',
-
- 'css-loader',
-
- 'sass-loader'
- ]
- };
-
- config.module.rules.push({
- test: /\.(js|ts|tsx)$/,
- exclude: /(node_modules)/,
- use: [
- {
- loader: require.resolve('babel-loader'),
- options: require('@polkadot/dev/config/babel')
- },
- ],
- });
- config.resolve.extensions.push('.js', '.ts', '.tsx');
-
- config.resolve.plugins = config.resolve.plugins || [];
- config.resolve.plugins.push(
- new TsconfigPathsPlugin({
- configFile: path.resolve(__dirname, '../tsconfig.json'),
- })
- );
-
- config.module.rules.push({
- test: /\.stories\.tsx?$/,
- loaders: [require.resolve('@storybook/source-loader')],
- enforce: 'pre',
- });
- return config;
- };
|