mirror of
https://github.com/dzeiocom/components.git
synced 2025-04-22 19:02:15 +00:00
38 lines
755 B
JavaScript
38 lines
755 B
JavaScript
module.exports = {
|
|
webpackFinal: async (baseConfig, options) => {
|
|
const { module = {} } = baseConfig;
|
|
|
|
const newConfig = {
|
|
...baseConfig,
|
|
module: {
|
|
...module,
|
|
rules: [...(module.rules || [])],
|
|
},
|
|
};
|
|
|
|
// TypeScript
|
|
newConfig.module.rules.push({
|
|
test: /\.(ts|tsx)$/,
|
|
// include: [path.resolve(__dirname, '../src/client/components')],
|
|
use: ['babel-loader', 'ts-loader']
|
|
});
|
|
newConfig.resolve.extensions.push('.ts', '.tsx');
|
|
|
|
// Stylus
|
|
newConfig.module.rules.push({
|
|
test: /\.styl$/,
|
|
use: ['style-loader', {
|
|
loader: 'css-loader',
|
|
options: {
|
|
url: false,
|
|
importLoaders: 1,
|
|
modules: true
|
|
},
|
|
}, 'stylus-loader'],
|
|
});
|
|
newConfig.resolve.extensions.push('.styl');
|
|
|
|
return newConfig;
|
|
},
|
|
};
|