rollup.config.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /**
  2. * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. /* jshint browser: false, node: true, strict: true */
  6. 'use strict';
  7. const path = require( 'path' );
  8. const ckeditorRollupPlugin = require( './ckeditor-rollup-plugin' );
  9. const nodeResolve = require( 'rollup-plugin-node-resolve' );
  10. const stringRollupPlugin = require( 'rollup-plugin-string' );
  11. const sassRollupPlugin = require( 'rollup-plugin-sass' );
  12. export default {
  13. entry: './webpack-entry-point.js',
  14. format: 'iife',
  15. dest: path.join( 'build', 'dist', 'ckeditor.js' ),
  16. plugins: [
  17. ckeditorRollupPlugin( {
  18. useMainPackageModules: true,
  19. mainPackagePath: process.cwd()
  20. } ),
  21. nodeResolve(),
  22. // TODO is it possible to include that in the CKEditor plugin?
  23. stringRollupPlugin( {
  24. include: '**/ckeditor5-*/theme/icons/*.svg'
  25. } ),
  26. sassRollupPlugin( {
  27. insert: true,
  28. include: '**/*.scss',
  29. exclude: [],
  30. options: {
  31. importer( url /*, prev */ ) {
  32. if ( url.startsWith( '~' ) ) {
  33. const path = process.cwd() + '/node_modules/' + url.slice( 1 );
  34. return {
  35. file: path
  36. };
  37. }
  38. }
  39. }
  40. } )
  41. ]
  42. };