mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-18 13:11:17 +02:00
Switch to using Rollup for bundling (#1568)
* Implement first working rollup config for main slate pkg * Convert slate-base64-serializer to rollup * Convert slate-dev-logger to rollup * Convert slate-html-serializer to rollup * Convert slate-hyperscript to rollup * Convert slate-plain-serializer to rollup * Convert slate-prop-types to rollup * Convert (mostly) slate-react to rollup * Convert slate-simulator to rollup * Misc cleanup and configuration tweaks/fixes * Convert slate-schema-violations to rollup * Successful rollup build for top-level examples * Add plugin to replace process.env.NODE_ENV * Only rebuild modules and dev examples in watch mode * Enable sourcemaps for development builds * Force debug to use browser version, remove builtins plugin * Remove is-image from example It relies on node `path` and wouldn't work well in-browser anyway * Use browser version of react-dom/server * Move stray require to import * Configure examples to watch child package output * Fix tests * Remove unneeded preferBuiltins from resolve config * Use more precise files array to ensure sourcemaps aren't included * Use lodash instead of lodash.throttle It's pulled in anyway since slate-react needs slate, so using the minipackage actually causes code duplication * Improve naming/fix UMD builds, update UMD doc * Add rollup configs to linting, add a missing dep to package.json * Use longform rollup CLI flags * Add rollup-plugin-auto-external to reduce external module configuration * Combine rollup config into a unioned helper * Centralize to a single rollup configuration * Update dist structure and package field naming for PR feedback * Add comments and address PR feedback on rollup config * i.e. -> e.g. * Add some spacing to the configuration to improve readability * Add a bit more spacing * Remove umd from example Slate unpkg link
This commit is contained in:
committed by
Ian Storm Taylor
parent
c044d048ad
commit
228b97ff29
@@ -4,7 +4,10 @@
|
||||
"version": "0.11.2",
|
||||
"license": "MIT",
|
||||
"repository": "git://github.com/ianstormtaylor/slate.git",
|
||||
"main": "./lib/index.js",
|
||||
"main": "lib/slate-react.js",
|
||||
"module": "lib/slate-react.es.js",
|
||||
"umd": "dist/slate-react.js",
|
||||
"umdMin": "dist/slate-react.min.js",
|
||||
"files": [
|
||||
"dist/",
|
||||
"lib/"
|
||||
@@ -16,7 +19,7 @@
|
||||
"is-in-browser": "^1.1.3",
|
||||
"is-window": "^1.0.2",
|
||||
"keycode": "^2.1.2",
|
||||
"lodash.throttle": "^4.1.1",
|
||||
"lodash": "^4.1.1",
|
||||
"prop-types": "^15.5.8",
|
||||
"react-immutable-proptypes": "^2.1.0",
|
||||
"react-portal": "^3.1.0",
|
||||
@@ -32,26 +35,18 @@
|
||||
"slate": "^0.32.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-cli": "^6.10.1",
|
||||
"browserify": "^13.0.1",
|
||||
"mocha": "^2.5.3",
|
||||
"slate": "^0.32.2",
|
||||
"slate-hyperscript": "^0.5.2",
|
||||
"slate-simulator": "^0.4.19",
|
||||
"uglify-js": "^2.7.0"
|
||||
"slate-simulator": "^0.4.19"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "babel --out-dir ./lib ./src",
|
||||
"build:max": "mkdir -p ./dist && NODE_ENV=production browserify ./src/index.js --transform babelify --transform envify --transform [ browserify-global-shim --global ] --standalone SlateReact > ./dist/slate-react.js",
|
||||
"build:min": "mkdir -p ./dist && NODE_ENV=production browserify ./src/index.js --transform babelify --transform envify --transform [ browserify-global-shim --global ] --transform uglifyify --standalone SlateReact | uglifyjs > ./dist/slate-react.min.js",
|
||||
"clean": "rm -rf ./dist ./lib ./node_modules",
|
||||
"prepublish": "yarn run build && yarn run build:max && yarn run build:min",
|
||||
"watch": "babel --watch --out-dir ./lib ./src --source-maps inline"
|
||||
"clean": "rm -rf ./dist ./lib ./node_modules"
|
||||
},
|
||||
"browserify-global-shim": {
|
||||
"umdGlobals": {
|
||||
"immutable": "Immutable",
|
||||
"react": "React",
|
||||
"react-dom": "ReactDOM",
|
||||
"react-dom/server": "ReactDOMServer",
|
||||
"slate": "Slate"
|
||||
},
|
||||
"keywords": [
|
||||
|
@@ -4,7 +4,7 @@ import React from 'react'
|
||||
import Types from 'prop-types'
|
||||
import getWindow from 'get-window'
|
||||
import logger from 'slate-dev-logger'
|
||||
import throttle from 'lodash.throttle'
|
||||
import throttle from 'lodash/throttle'
|
||||
|
||||
import EVENT_HANDLERS from '../constants/event-handlers'
|
||||
import Node from './node'
|
||||
|
Reference in New Issue
Block a user