Comments (5)
推荐去掉 babel, 使用 sucrase
from react-code-preview.
@react-spy 这是因为使用在线编译 ES 代码的 babel 工具 @babel/standalone
,本身体积非常大,无法解决这个问题。
可以将它分拆成几个 js 加载,这样加载就变得会快一些。
react-code-preview/src/transform.tsx
Lines 1 to 13 in c8baefc
from react-code-preview.
如何将@babel 拆分啊?我只会页面js的拆分,有例子提供一下吗?感谢
from react-code-preview.
@react-spy 修改 webpack 配置类似于下面这种方法。
Lines 26 to 64 in c8baefc
from react-code-preview.
@huijiewei 我在 kktjs/markdown-react-code-preview-loader#1 (comment) 项目中试了一下很多问题。
from react-code-preview.
Related Issues (8)
- ERROR in ./node_modules/uiw-iconfont/fonts/w-icon.json Module parse failed: Unexpected token m in JSON at position 0 while parsing near 'module.exports = {"a...' You may need an appropriate loader to handle this file type. HOT 5
- Dependency Dashboard
- 在 react 17 中报错
- problem in using in Nextjs HOT 1
- 可以增加布局方向设置吗 HOT 1
- Action Required: Fix Renovate Configuration
- Critical dependency: the request of a dependency is an expression HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-code-preview.