Last active
September 2, 2022 20:36
-
-
Save andreypelykh/df5a1a56aadc5ded41f9a6397a215e65 to your computer and use it in GitHub Desktop.
Webpack config exports an object
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { styles } = require('@ckeditor/ckeditor5-dev-utils'); | |
module.exports = { | |
module: { | |
rules: [ | |
// Your existing rules (example) | |
{ | |
test: /\.css$/, | |
use: [ | |
{ | |
loader: 'style-loader', | |
options: { | |
// `style-loader` options here... | |
} | |
} | |
] | |
}, | |
// CKEditor rules from the docs | |
// https://ckeditor.com/docs/ckeditor5/latest/installation/getting-started/quick-start-other.html#building-the-editor-from-source | |
{ | |
test: /ckeditor5-[^/\\]+[/\\]theme[/\\]icons[/\\][^/\\]+\.svg$/, | |
use: ['raw-loader'], | |
}, | |
{ | |
test: /ckeditor5-[^/\\]+[/\\]theme[/\\].+\.css$/, | |
use: [ | |
{ | |
loader: 'style-loader', | |
options: { | |
injectType: 'singletonStyleTag', | |
attributes: { | |
'data-cke': true, | |
}, | |
}, | |
}, | |
'css-loader', | |
{ | |
loader: 'postcss-loader', | |
options: { | |
postcssOptions: styles.getPostCssConfig({ | |
themeImporter: { | |
themePath: require.resolve('@ckeditor/ckeditor5-theme-lark'), | |
}, | |
minify: false, | |
}), | |
}, | |
}, | |
], | |
} | |
] | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment