webpack-library.config.js 1022 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. const path = require( 'path' );
  7. const CKEditorWebpackPlugin = require( './ckeditor-webpack-plugin' );
  8. const webpack = require( 'webpack' );
  9. module.exports = {
  10. context: __dirname,
  11. target: 'web',
  12. entry: {
  13. ClassicEditor: 'ckeditor5-editor-classic/src/classic',
  14. CKEditorPresetBasic: './ckeditor-preset-basic',
  15. CKEditorList: 'ckeditor5-list/src/list',
  16. CKEditorLink: 'ckeditor5-link/src/link',
  17. CKEditorHeading: 'ckeditor5-heading/src/heading',
  18. },
  19. output: {
  20. path: path.join( 'build', 'dist' ),
  21. filename: '[name].ckeditor.js',
  22. library: '[name]',
  23. },
  24. devtool: 'cheap-source-map',
  25. plugins: [
  26. new CKEditorWebpackPlugin( {
  27. useMainPackageModules: true,
  28. mainPackagePath: process.cwd()
  29. } ),
  30. new webpack.optimize.CommonsChunkPlugin( {
  31. name: 'ClassicEditor',
  32. // children: true,
  33. minChunks: 2
  34. } )
  35. ],
  36. };