summaryrefslogtreecommitdiff
path: root/lib/ckeditor5/webpack.config.js
diff options
context:
space:
mode:
authorpolo <ordipolo@gmx.fr>2022-02-17 18:13:00 +0100
committerpolo <ordipolo@gmx.fr>2022-02-17 18:13:00 +0100
commit787d03e48471ba62cd830379428f04d996f0b74b (patch)
treee9f98c7b9288c4530b50985688dd82622106ba2d /lib/ckeditor5/webpack.config.js
parent29df6f1362745eabf4fbcaedf309eb63795152fa (diff)
downloadmelaine-787d03e48471ba62cd830379428f04d996f0b74b.zip
model update
Diffstat (limited to 'lib/ckeditor5/webpack.config.js')
-rw-r--r--lib/ckeditor5/webpack.config.js192
1 files changed, 96 insertions, 96 deletions
diff --git a/lib/ckeditor5/webpack.config.js b/lib/ckeditor5/webpack.config.js
index 4c7efd3..4a69362 100644
--- a/lib/ckeditor5/webpack.config.js
+++ b/lib/ckeditor5/webpack.config.js
@@ -1,96 +1,96 @@
1/** 1/**
2 * @license Copyright (c) 2014-2021, CKSource - Frederico Knabben. All rights reserved. 2 * @license Copyright (c) 2014-2021, CKSource - Frederico Knabben. All rights reserved.
3 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license 3 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4 */ 4 */
5 5
6'use strict'; 6'use strict';
7 7
8/* eslint-env node */ 8/* eslint-env node */
9 9
10const path = require( 'path' ); 10const path = require( 'path' );
11const webpack = require( 'webpack' ); 11const webpack = require( 'webpack' );
12const { bundler, styles } = require( '@ckeditor/ckeditor5-dev-utils' ); 12const { bundler, styles } = require( '@ckeditor/ckeditor5-dev-utils' );
13const CKEditorWebpackPlugin = require( '@ckeditor/ckeditor5-dev-webpack-plugin' ); 13const CKEditorWebpackPlugin = require( '@ckeditor/ckeditor5-dev-webpack-plugin' );
14const TerserWebpackPlugin = require( 'terser-webpack-plugin' ); 14const TerserWebpackPlugin = require( 'terser-webpack-plugin' );
15 15
16module.exports = { 16module.exports = {
17 devtool: 'source-map', 17 devtool: 'source-map',
18 performance: { hints: false }, 18 performance: { hints: false },
19 19
20 entry: path.resolve( __dirname, 'src', 'ckeditor.js' ), 20 entry: path.resolve( __dirname, 'src', 'ckeditor.js' ),
21 21
22 output: { 22 output: {
23 // The name under which the editor will be exported. 23 // The name under which the editor will be exported.
24 library: 'ClassicEditor', 24 library: 'ClassicEditor',
25 25
26 path: path.resolve( __dirname, 'build' ), 26 path: path.resolve( __dirname, 'build' ),
27 filename: 'ckeditor.js', 27 filename: 'ckeditor.js',
28 libraryTarget: 'umd', 28 libraryTarget: 'umd',
29 libraryExport: 'default' 29 libraryExport: 'default'
30 }, 30 },
31 31
32 optimization: { 32 optimization: {
33 minimizer: [ 33 minimizer: [
34 new TerserWebpackPlugin( { 34 new TerserWebpackPlugin( {
35 sourceMap: true, 35 sourceMap: true,
36 terserOptions: { 36 terserOptions: {
37 output: { 37 output: {
38 // Preserve CKEditor 5 license comments. 38 // Preserve CKEditor 5 license comments.
39 comments: /^!/ 39 comments: /^!/
40 } 40 }
41 }, 41 },
42 extractComments: false 42 extractComments: false
43 } ) 43 } )
44 ] 44 ]
45 }, 45 },
46 46
47 plugins: [ 47 plugins: [
48 new CKEditorWebpackPlugin( { 48 new CKEditorWebpackPlugin( {
49 // UI language. Language codes follow the https://en.wikipedia.org/wiki/ISO_639-1 format. 49 // UI language. Language codes follow the https://en.wikipedia.org/wiki/ISO_639-1 format.
50 // When changing the built-in language, remember to also change it in the editor's configuration (src/ckeditor.js). 50 // When changing the built-in language, remember to also change it in the editor's configuration (src/ckeditor.js).
51 language: 'fr', 51 language: 'fr',
52 additionalLanguages: 'all' 52 additionalLanguages: 'all'
53 } ), 53 } ),
54 new webpack.BannerPlugin( { 54 new webpack.BannerPlugin( {
55 banner: bundler.getLicenseBanner(), 55 banner: bundler.getLicenseBanner(),
56 raw: true 56 raw: true
57 } ) 57 } )
58 ], 58 ],
59 59
60 module: { 60 module: {
61 rules: [ 61 rules: [
62 { 62 {
63 test: /\.svg$/, 63 test: /\.svg$/,
64 use: [ 'raw-loader' ] 64 use: [ 'raw-loader' ]
65 }, 65 },
66 { 66 {
67 test: /\.css$/, 67 test: /\.css$/,
68 use: [ 68 use: [
69 { 69 {
70 loader: 'style-loader', 70 loader: 'style-loader',
71 options: { 71 options: {
72 injectType: 'singletonStyleTag', 72 injectType: 'singletonStyleTag',
73 attributes: { 73 attributes: {
74 'data-cke': true 74 'data-cke': true
75 } 75 }
76 } 76 }
77 }, 77 },
78 { 78 {
79 loader: 'css-loader' 79 loader: 'css-loader'
80 }, 80 },
81 { 81 {
82 loader: 'postcss-loader', 82 loader: 'postcss-loader',
83 options: { 83 options: {
84 postcssOptions: styles.getPostCssConfig( { 84 postcssOptions: styles.getPostCssConfig( {
85 themeImporter: { 85 themeImporter: {
86 themePath: require.resolve( '@ckeditor/ckeditor5-theme-lark' ) 86 themePath: require.resolve( '@ckeditor/ckeditor5-theme-lark' )
87 }, 87 },
88 minify: true 88 minify: true
89 } ) 89 } )
90 } 90 }
91 }, 91 },
92 ] 92 ]
93 } 93 }
94 ] 94 ]
95 } 95 }
96}; 96};