mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-09-08 06:00:40 +02:00
fix require issue in bundle, add sourcemaps
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Value } from 'slate'
|
||||
import { Node, Value } from 'slate'
|
||||
import { atob, btoa } from 'isomorphic-base64'
|
||||
|
||||
/**
|
||||
@@ -48,7 +48,6 @@ function deserialize(string, options) {
|
||||
*/
|
||||
|
||||
function deserializeNode(string, options) {
|
||||
const { Node } = require('slate')
|
||||
const raw = decode(string)
|
||||
const node = Node.fromJSON(raw, options)
|
||||
return node
|
||||
|
@@ -27,7 +27,7 @@ function configure(env) {
|
||||
name: 'slate-examples',
|
||||
format: 'umd',
|
||||
exports: 'named',
|
||||
sourcemap: isDev,
|
||||
sourcemap: isDev ? 'inline' : false,
|
||||
},
|
||||
watch: {
|
||||
include: ['examples/**', 'packages/*/lib/*.es.js'],
|
||||
@@ -86,7 +86,7 @@ function configure(env) {
|
||||
// Only minify the output in production, since it is very slow.
|
||||
isProd && uglify(),
|
||||
|
||||
// Only add sourcemaps in development.
|
||||
// Only parse sourcemaps of dependencies in development.
|
||||
isDev && sourcemaps(),
|
||||
].filter(Boolean),
|
||||
}
|
||||
|
@@ -112,6 +112,7 @@ function configure(pkg, env, target) {
|
||||
file: `packages/${pkg.name}/${pkg.main}`,
|
||||
format: 'cjs',
|
||||
exports: 'named',
|
||||
sourcemap: isDev,
|
||||
},
|
||||
],
|
||||
// We need to explicitly state which modules are external, meaning that
|
||||
|
Reference in New Issue
Block a user