corelibs/ckeditor/webpack.config.js

47 lines
877 B
JavaScript

"use strict";
const path = require( "path" );
const {styles} = require( "@ckeditor/ckeditor5-dev-utils" );
module.exports = {
entry: "./app.js",
output: {
path: path.resolve( __dirname, "dist" ),
filename: "ckeditor.js"
},
module: {
rules: [
{
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: true
})
}
}
]
}
]
}
};