grafana/packages/grafana-ui/.storybook/webpack.config.js

57 lines
1.1 KiB
JavaScript
Raw Normal View History

2019-01-09 02:40:57 -06:00
const path = require('path');
module.exports = (baseConfig, env, config) => {
2019-01-09 02:40:57 -06:00
config.module.rules.push({
test: /\.(ts|tsx)$/,
use: [
{
loader: require.resolve('awesome-typescript-loader'),
},
],
});
2019-01-09 02:40:57 -06:00
config.module.rules.push({
test: /\.scss$/,
use: [
{
loader: 'style-loader',
},
{
loader: 'css-loader',
options: {
importLoaders: 2,
url: false,
sourceMap: false,
minimize: false,
},
},
{
loader: 'postcss-loader',
options: {
sourceMap: false,
config: { path: __dirname + '../../../../scripts/webpack/postcss.config.js' },
},
},
{ loader: 'sass-loader', options: { sourceMap: false } },
],
});
config.module.rules.push({
test: require.resolve('jquery'),
use: [
{
loader: 'expose-loader',
query: 'jQuery',
},
{
loader: 'expose-loader',
query: '$',
},
],
});
2019-01-09 02:40:57 -06:00
config.resolve.extensions.push('.ts', '.tsx');
return config;
};