Skip to content
This repository was archived by the owner on Feb 19, 2025. It is now read-only.

Commit c71d67a

Browse files
authored
Merge pull request #112 from supabase/feature/treeshaking
Feature/treeshaking
2 parents 7aaf351 + 101e3b3 commit c71d67a

File tree

650 files changed

+7608
-656
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

650 files changed

+7608
-656
lines changed

.storybook/main.js

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,21 @@
1-
const babel = require('@babel/core');
1+
const babel = require('@babel/core')
2+
const postCssLoader = './postCssLoader'
23

34
module.exports = {
4-
"stories": [
5-
"../src/**/*.stories.mdx",
6-
"../src/**/*.stories.@(js|jsx|ts|tsx)"
5+
stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
6+
addons: [
7+
'@storybook/addon-links',
8+
'@storybook/addon-essentials',
9+
'storybook-dark-mode/register',
10+
postCssLoader,
711
],
8-
"addons": [
9-
"@storybook/addon-links",
10-
"@storybook/addon-essentials",
11-
'storybook-dark-mode/register'
12-
],
13-
webpackFinal: async config => {
14-
12+
webpackFinal: async (config) => {
1513
// This is for fix webpack storybook get module @emotion/styled/base
1614
// It's wrong module, the right module is @emotion/styled-base
1715
config.resolve.alias = {
18-
'@emotion/styled/base': '@emotion/styled-base'
16+
'@emotion/styled/base': '@emotion/styled-base',
1917
}
2018

21-
return config;
22-
}
23-
}
19+
return config
20+
},
21+
}

.storybook/postCssLoader.js

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
// taken from
2+
// https://github.com/Negan1911/storybook-css-modules-preset/blob/master/index.js
3+
4+
const css_regex = '/\\.css$/'
5+
6+
module.exports = {
7+
webpackFinal(config = {}, options = {}) {
8+
const cssRule = config.module.rules.find(
9+
(_) => _.test.toString() === css_regex
10+
)
11+
12+
return {
13+
...config,
14+
module: {
15+
...config.module,
16+
rules: [
17+
...config.module.rules.filter((_) => _.test.toString() !== css_regex),
18+
{
19+
...cssRule,
20+
exclude: /\.module\.css$/,
21+
},
22+
{
23+
...cssRule,
24+
test: /\.module\.css$/,
25+
use: cssRule.use.map((_) => {
26+
if (_ && _.loader && _.loader.match(/\/css-loader/g)) {
27+
return {
28+
..._,
29+
options: {
30+
..._.options,
31+
// modules: true,
32+
modules: {
33+
// localIdentName: '[name]__[local]__[hash:base64:5]',
34+
localIdentName: '[local]',
35+
},
36+
},
37+
}
38+
}
39+
40+
return _
41+
}),
42+
},
43+
],
44+
},
45+
}
46+
},
47+
}

.storybook/preview.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import './preview.css'
44
export const parameters = {
55
actions: { argTypesRegex: '^on[A-Z].*' },
66
darkMode: {
7-
current: 'dark',
87
darkClass: 'dark',
98
lightClass: 'light',
109
stylePreview: true,

internals/icons.js

Lines changed: 288 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)