| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- /**
- * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
- */
- 'use strict';
- /* eslint-env node */
- const path = require( 'path' );
- const webpack = require( 'webpack' );
- const { bundler } = require( '@ckeditor/ckeditor5-dev-utils' );
- const { getPostCssConfig } = require( '@ckeditor/ckeditor5-dev-utils' ).styles;
- const CKEditorWebpackPlugin = require( '@ckeditor/ckeditor5-dev-webpack-plugin' );
- const BabiliPlugin = require( 'babel-minify-webpack-plugin' );
- const buildConfig = require( './build-config' );
- module.exports = {
- devtool: 'source-map',
- entry: path.resolve( __dirname, 'src', 'ckeditor.js' ),
- output: {
- path: path.resolve( __dirname, 'build' ),
- filename: 'ckeditor.js',
- libraryTarget: 'umd',
- libraryExport: 'default',
- library: buildConfig.moduleName
- },
- plugins: [
- new CKEditorWebpackPlugin( {
- languages: [ buildConfig.language ]
- } ),
- new BabiliPlugin( null, {
- comments: false
- } ),
- new webpack.BannerPlugin( {
- banner: bundler.getLicenseBanner(),
- raw: true
- } )
- ],
- module: {
- rules: [
- {
- test: /\.svg$/,
- use: [ 'raw-loader' ]
- },
- {
- test: /\.css$/,
- use: [
- {
- loader: 'style-loader',
- options: {
- singleton: true
- }
- },
- {
- loader: 'postcss-loader',
- options: getPostCssConfig( {
- themePath: path.resolve( __dirname, 'node_modules/@ckeditor/ckeditor5-theme-lark' ),
- minify: true
- } )
- },
- ]
- }
- ]
- }
- };
|