8
0

webpack.config.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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( './node_modules/@ckeditor/ckeditor5-dev-tests/ckeditor-webpack-plugin' );
  8. module.exports = {
  9. context: __dirname,
  10. target: 'web',
  11. entry: './webpack-entry-point',
  12. output: {
  13. path: path.join( 'build', 'dist' ),
  14. filename: 'ckeditor.js',
  15. },
  16. // TODO is it possible to include that in the CKEditor plugin?
  17. module: {
  18. rules: [
  19. {
  20. // test: **/ckeditor5-*/theme/icons/*.svg
  21. test: /ckeditor5-[^/]+\/theme\/icons\/[^/]+\.svg$/,
  22. use: [ 'raw-loader' ]
  23. },
  24. {
  25. // test: **/ckeditor5-*/theme/**/*.scss
  26. test: /\.scss$/,
  27. use: [ 'style-loader', 'css-loader', 'sass-loader' ]
  28. }
  29. ]
  30. },
  31. // resolve: {
  32. // modules: [
  33. // path.resolve( __dirname, 'node_modules' ),
  34. // 'node_modules'
  35. // ]
  36. // },
  37. devtool: 'cheap-source-map',
  38. plugins: [
  39. new CKEditorWebpackPlugin( {
  40. packages: {
  41. '*': path.join( process.cwd(), 'node_modules' )
  42. }
  43. } )
  44. ],
  45. };