1
0
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:
Ian Storm Taylor
2018-02-07 10:53:44 -08:00
parent de4c9e478a
commit 043e1a5fb5
3 changed files with 4 additions and 4 deletions

View File

@@ -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

View File

@@ -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),
}

View File

@@ -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