Feature request: Skip babel transpilation
See original GitHub issueIssue Description
Tell us how you think we can improve Sandpack
To give some context, I have additional library files in a public
folder that is meant to be statically served. Currently, I am passing it to the Sandpack
component via the files
prop. However, these files have already been transpiled and passing them through the files
prop seems to make the babel transpiler do it again. You would think that running it through would not have much impact but it turns out it just generates errors.
Packages affected
- sandpack-client
- sandpack-react
What is this feature?
I am proposing that a flag be added to the SandpackFile
type to skip babel transpilation.
How would your idea work?
<Sandpack
files={{
'/public/jquery.min.js': {
code: '/public/jquery.min.js',
transpile: false, // Default: true
}
}}
/>
Issue Analytics
- State:
- Created a year ago
- Reactions:11
- Comments:6 (4 by maintainers)
Top Results From Across the Web
grunt: skip babel transpile for core-js #1466 - GitHub
Summary Previously grunt build would transpile the output of browserify to transpile all dependencies, but this would make some dependencies, ...
Read more >Why you don't need Babel - LogRocket Blog
A common solution is to write using the latest features and transpile down to older-style code the browser will understand.
Read more >babel/register - Babel.js
One of the ways you can use Babel is through the require hook. The require hook will bind itself to node's require and...
Read more >Advanced Features: Customizing Babel Config - Next.js
But if you want to extend the default Babel configs, it's also possible. To start, you only need to define a .babelrc file...
Read more >next-transpile-modules - npm
All features of next-transpile-modules are now natively built-in Next.js ... Transpile modules from node_modules using the Next.js Babel ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@danilowoz this is definitely doable and not a whole lot of work, was gonna work on related tasks anyway in a couple weeks. However this code would still be passed through our custom transformer that collects dependencies and rewrites import statements which uses acorn and it super-fast.
Or should it be more of an isolated module that can never have any dependencies?
Sounds very similar to #119 which we already support in the bundler
@danilowoz Is this issue still open?