1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-02-13 11:44:55 +01:00
slate/rollup.config.js

32 lines
1.2 KiB
JavaScript
Raw Normal View History

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
2018-02-02 18:46:36 -05:00
import factory from './support/rollup/factory'
import examplesConfig from './support/rollup/examples'
import slate from './packages/slate/package.json'
import slateBase64Serializer from './packages/slate-base64-serializer/package.json'
import slateDevLogger from './packages/slate-dev-logger/package.json'
import slateHtmlSerializer from './packages/slate-html-serializer/package.json'
import slateHyperscript from './packages/slate-hyperscript/package.json'
import slatePlainSerializer from './packages/slate-plain-serializer/package.json'
import slatePropTypes from './packages/slate-prop-types/package.json'
import slateReact from './packages/slate-react/package.json'
import slateSchemaViolations from './packages/slate-schema-violations/package.json'
import slateSimulator from './packages/slate-simulator/package.json'
const configurations = [
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
2018-02-02 18:46:36 -05:00
...factory(slate),
...factory(slateBase64Serializer),
...factory(slateDevLogger),
...factory(slateHtmlSerializer),
...factory(slateHyperscript),
...factory(slatePlainSerializer),
...factory(slatePropTypes),
...factory(slateReact),
...factory(slateSchemaViolations),
...factory(slateSimulator),
]
if (!process.env.SKIP_EXAMPLES) {
configurations.push(...examplesConfig)
}
export default configurations