2021-04-29 16:42:06 +00:00
|
|
|
const path = require('path');
|
|
|
|
const resolve = require('../config/webpack/resolve');
|
|
|
|
|
|
|
|
// Chatwoot's webpack.config.js
|
|
|
|
process.env.NODE_ENV = 'development';
|
|
|
|
const custom = require('../config/webpack/environment');
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
stories: [
|
|
|
|
'../stories/**/*.stories.mdx',
|
2021-05-02 09:10:46 +00:00
|
|
|
'../app/javascript/**/*.stories.@(js|jsx|ts|tsx)',
|
2021-04-29 16:42:06 +00:00
|
|
|
],
|
|
|
|
addons: [
|
|
|
|
{
|
|
|
|
name: '@storybook/addon-docs',
|
|
|
|
options: {
|
|
|
|
vueDocgenOptions: {
|
|
|
|
alias: {
|
|
|
|
'@': path.resolve(__dirname, '../'),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
'@storybook/addon-links',
|
|
|
|
'@storybook/addon-essentials',
|
|
|
|
],
|
|
|
|
webpackFinal: config => {
|
|
|
|
const newConfig = {
|
|
|
|
...config,
|
|
|
|
resolve: {
|
|
|
|
...config.resolve,
|
|
|
|
modules: custom.resolvedModules.map(i => i.value),
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
newConfig.module.rules.push({
|
|
|
|
test: /\.scss$/,
|
|
|
|
use: ['style-loader', 'css-loader', 'sass-loader'],
|
|
|
|
include: path.resolve(__dirname, '../app/javascript'),
|
|
|
|
});
|
|
|
|
|
|
|
|
return newConfig;
|
|
|
|
},
|
|
|
|
};
|