Browse Source

Updated webpack configuration to enable PostCSS and themes.

Aleksander Nowodzinski 8 years ago
parent
commit
e129a811f9

+ 2 - 3
packages/ckeditor5-build-balloon/package.json

@@ -28,12 +28,11 @@
     "@ckeditor/ckeditor5-link": "^1.0.0-alpha.2",
     "@ckeditor/ckeditor5-list": "^1.0.0-alpha.2",
     "@ckeditor/ckeditor5-paragraph": "^1.0.0-alpha.2",
+    "@ckeditor/ckeditor5-theme-lark": "^1.0.0-alpha.2",
     "@ckeditor/ckeditor5-upload": "^1.0.0-alpha.2",
     "babel-minify-webpack-plugin": "^0.2.0",
-    "css-loader": "^0.28.7",
-    "node-sass": "^4.5.3",
+    "postcss-loader": "^2.0.8",
     "raw-loader": "^0.5.1",
-    "sass-loader": "^6.0.6",
     "style-loader": "^0.18.2",
     "webpack": "^3.6.0",
     "webpack-sources": "1.0.1"

+ 13 - 5
packages/ckeditor5-build-balloon/webpack.config.js

@@ -10,6 +10,7 @@
 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' );
@@ -48,16 +49,23 @@ module.exports = {
 				use: [ 'raw-loader' ]
 			},
 			{
-				test: /\.scss$/,
+				test: /\.css$/,
 				use: [
-					'style-loader',
 					{
-						loader: 'css-loader',
+						loader: 'style-loader',
 						options: {
-							minimize: true
+							singleton: true
 						}
 					},
-					'sass-loader'
+					{
+						loader: 'postcss-loader',
+						options: getPostCssConfig( {
+							themeimporter: {
+								themePath: require.resolve( '@ckeditor/ckeditor5-theme-lark' )
+							},
+							minify: true
+						} )
+					},
 				]
 			}
 		]