question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Distribution as single file

See original GitHub issue

Is it possible to get slate.js as complete js file(bundle)? I see that when I run dist it will produce slate.js but that file will require a lot of other files.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
podviaznikovcommented, Aug 8, 2016

Thanks, now everything works!

0reactions
ianstormtaylorcommented, Aug 8, 2016

I haven’t actually written non-Babel-ized code in a while 😄 but off the top of my head I think you’d need to be doing something along the lines of:

var Editor = Slate.Editor
var Plain = Slate.Plain

var state = Plain.deserialize('Some content...')
var editor = React.createElement(Editor, { state: state })
var app = document.getElementById('app')

ReactDOM.render(editor,  app)

And if you want to allow changes to happen, you’ll need to pass an onChange property like the examples showcase. Check out the plain-text example for the simplest case: https://github.com/ianstormtaylor/slate/blob/master/examples/plain-text/index.js

Read more comments on GitHub >

github_iconTop Results From Across the Web

Create a single file for application deployment - .NET
In .NET Core 3.x, publishing as a single file produced one file, consisting of the app itself, dependencies, and any other files in...
Read more >
Creating a Single Executable File for Distribution
To package a build as a single executable file by using the settings in the Releases view: 1. In the View List under...
Read more >
Building a single-file distribution with 8.7 - the Tcler's Wiki!
Building a single-file distribution with 8.7. Tcl and Tk have regular builds of their code as single file distributions.
Read more >
Build Single File for Distribution · Issue #1452 - GitHub
I'm building a small app that will need to act as a library for a client. They will need to pull a single...
Read more >
Distribution files - Help+Manual
Like any website it consists of a large number of separate files, including HTML files, graphics files, JavaScript files and other files all...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found