Skip to content

Commit 4bd0725

Browse files
committed
feat: test fileIcon render
1 parent 4b3573e commit 4bd0725

8 files changed

+56
-153076
lines changed

build/webpack.base.js

+11-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
const path = require('path');
22
const webpack = require('webpack');
33
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');
4+
const CopyWebpackPlugin = require('copy-webpack-plugin');
45

56
module.exports = {
67
mode: 'development',
@@ -19,18 +20,15 @@ module.exports = {
1920
path: path.resolve(__dirname, '../dist'),
2021
},
2122
module: {
22-
rules: [
23-
{
23+
rules: [{
2424
test: /\.(js|jsx|tsx|ts)$/,
2525
exclude: /node_modules/,
26-
use: [
27-
{
26+
use: [{
2827
loader: require.resolve('ts-loader'),
2928
options: {
3029
transpileOnly: true,
3130
},
3231
},
33-
// Optional
3432
{
3533
loader: require.resolve(
3634
'react-docgen-typescript-loader'
@@ -51,5 +49,12 @@ module.exports = {
5149
new webpack.DefinePlugin({
5250
__DEVELOPMENT__: true,
5351
}),
52+
new CopyWebpackPlugin({
53+
patterns: [{
54+
context: path.resolve(__dirname, '../'),
55+
from: './src/static',
56+
to: './static'
57+
}]
58+
})
5459
],
55-
};
60+
};

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
"loadsh": "^0.0.4",
3333
"monaco-editor": "^0.21.2",
3434
"rc-collapse": "^2.0.1",
35-
"rc-tabs": "11.7.0",
3635
"rc-tree": "^3.10.0",
3736
"react": "^16.13.1",
3837
"react-dnd": "^9.3.4",

src/components/fileIcon/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
} from 'vscode-icons-js';
88
import { prefixClaName, classNames } from 'mo/common/className';
99

10-
const ICON_BASE_PATH = './src/static/fileIcons/';
10+
const ICON_BASE_PATH = '/static/fileIcons/';
1111

1212
export interface Props {
1313
fileName: string;

storybook-static/index.html

+34-56
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,35 @@
1-
<!DOCTYPE html>
2-
<html lang="en">
3-
<head>
4-
<meta charset="utf-8" />
5-
<title>Storybook</title>
6-
<meta name="viewport" content="width=device-width,initial-scale=1" />
7-
<style>
8-
html,
9-
body {
10-
overflow: hidden;
11-
height: 100%;
12-
width: 100%;
13-
margin: 0;
14-
padding: 0;
15-
}
1+
<!doctype html><html lang="en"><head><meta charset="utf-8"/><title>Storybook</title><meta name="viewport" content="width=device-width,initial-scale=1"/><style>html, body {
2+
overflow: hidden;
3+
height: 100%;
4+
width: 100%;
5+
margin: 0;
6+
padding: 0;
7+
}
168

17-
* {
18-
box-sizing: border-box;
19-
}
20-
</style>
21-
<script>
22-
/* globals window */
23-
/* eslint-disable no-underscore-dangle */
24-
try {
25-
if (window.top !== window) {
26-
window.__REACT_DEVTOOLS_GLOBAL_HOOK__ =
27-
window.top.__REACT_DEVTOOLS_GLOBAL_HOOK__;
28-
}
29-
} catch (e) {
30-
// eslint-disable-next-line no-console
31-
console.warn(
32-
'unable to connect to top frame for connecting dev tools'
33-
);
34-
}
35-
</script>
36-
<style>
37-
#root[hidden],
38-
#docs-root[hidden] {
39-
display: none !important;
40-
}
41-
</style>
42-
</head>
43-
<body>
44-
<div id="root"></div>
45-
<div id="docs-root"></div>
46-
<script>
47-
window['CONFIG_TYPE'] = 'PRODUCTION';
48-
49-
window['LOGLEVEL'] = 'info';
50-
51-
window['DOCS_MODE'] = false;
52-
</script>
53-
<script src="runtime~main.870e8ee0658e83d05c6b.bundle.js"></script>
54-
<script src="vendors~main.df55eb6755cc252f6dde.bundle.js"></script>
55-
<script src="main.51cfd75dd6301db50e85.bundle.js"></script>
56-
</body>
57-
</html>
9+
* {
10+
box-sizing: border-box;
11+
}</style><script>/* globals window */
12+
/* eslint-disable no-underscore-dangle */
13+
try {
14+
if (window.top !== window) {
15+
window.__REACT_DEVTOOLS_GLOBAL_HOOK__ = window.top.__REACT_DEVTOOLS_GLOBAL_HOOK__;
16+
}
17+
} catch (e) {
18+
// eslint-disable-next-line no-console
19+
console.warn('unable to connect to top frame for connecting dev tools');
20+
}</script><style>#root[hidden],
21+
#docs-root[hidden] {
22+
display: none !important;
23+
}</style></head><body><div id="root"></div><div id="docs-root"></div><script>window['CONFIG_TYPE'] = "PRODUCTION";
24+
25+
26+
27+
window['LOGLEVEL'] = "info";
28+
29+
30+
31+
32+
33+
34+
35+
window['DOCS_MODE'] = false;</script><script src="runtime~main.870e8ee0658e83d05c6b.bundle.js"></script><script src="vendors~main.df55eb6755cc252f6dde.bundle.js"></script><script src="main.51cfd75dd6301db50e85.bundle.js"></script></body></html>

storybook-static/main.51cfd75dd6301db50e85.bundle.js

+1-18
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

storybook-static/runtime~main.870e8ee0658e83d05c6b.bundle.js

+1-144
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)