webpack.config.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /**
  2. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. 'use strict';
  6. const path = require( 'path' );
  7. const webpack = require( 'webpack' );
  8. const { bundler } = require( '@ckeditor/ckeditor5-dev-utils' );
  9. const CKEditorWebpackPlugin = require( '@ckeditor/ckeditor5-dev-webpack-plugin' );
  10. const BabiliPlugin = require( 'babili-webpack-plugin' );
  11. const buildConfig = require( './build-config' );
  12. module.exports = {
  13. devtool: 'source-map',
  14. entry: path.resolve( __dirname, 'ckeditor.js' ),
  15. output: {
  16. path: path.resolve( __dirname, 'build' ),
  17. filename: 'ckeditor.js',
  18. libraryTarget: 'umd'
  19. },
  20. plugins: [
  21. new CKEditorWebpackPlugin( {
  22. languages: [ buildConfig.language ]
  23. } ),
  24. new BabiliPlugin( null, {
  25. comments: false
  26. } ),
  27. new webpack.BannerPlugin( {
  28. banner: bundler.getLicenseBanner(),
  29. raw: true
  30. } )
  31. ],
  32. module: {
  33. rules: [
  34. {
  35. test: /\.svg$/,
  36. use: [ 'raw-loader' ]
  37. },
  38. {
  39. test: /\.scss$/,
  40. use: [
  41. 'style-loader',
  42. {
  43. loader: 'css-loader',
  44. options: {
  45. minimize: true
  46. }
  47. },
  48. 'sass-loader'
  49. ]
  50. }
  51. ]
  52. }
  53. };