-
Notifications
You must be signed in to change notification settings - Fork 0
/
cosmos.config.js
28 lines (27 loc) · 948 Bytes
/
cosmos.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
const autoprefixer = require('autoprefixer');
module.exports = {
containerQuerySelector: '#root',
publicPath: 'public',
// Optional: Add this when you start using proxies
//proxiesPath: 'src/cosmos.proxies'
webpack: (config, { env }) => {
// Return customized config
config.module.rules.push({
test: /\.(ts|tsx)$/,
loader: require.resolve('ts-loader')
});
config.module.rules.push({
loader: require.resolve('file-loader'),
// Exclude `js` files to keep "css" loader working as it injects
// it's runtime that would otherwise processed through "file" loader.
// Also exclude `html` and `json` extensions so they get processed
// by webpacks internal loaders.
exclude: [/\.(js|jsx|mjs|ts|tsx|css)$/, /\.html$/, /\.json$/],
options: {
name: 'static/media/[name].[ext]'
}
});
config.resolve.extensions.push('.ts', '.tsx');
return config;
}
};