Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update webpack.config.js and package.json to support PostCSS #37

Open
oleq opened this issue Feb 2, 2018 · 0 comments
Open

Update webpack.config.js and package.json to support PostCSS #37

oleq opened this issue Feb 2, 2018 · 0 comments

Comments

@oleq
Copy link
Collaborator

oleq commented Feb 2, 2018

diff --git a/package.json b/package.json
index 18261989..d24ae539 100644
--- a/package.json
+++ b/package.json
@@ -30,16 +30,14 @@
     "@ckeditor/ckeditor5-utils": "^1.0.0-alpha.2"
   },
   "devDependencies": {
-    "@ckeditor/ckeditor5-dev-utils": "^5.0.0",
-    "@ckeditor/ckeditor5-dev-webpack-plugin": "^2.0.22",
+    "@ckeditor/ckeditor5-dev-utils": "^7.0.3",
+    "@ckeditor/ckeditor5-dev-webpack-plugin": "^3.0.4",
     "babel-minify-webpack-plugin": "^0.2.0",
-    "css-loader": "^0.28.7",
-    "extract-text-webpack-plugin": "^3.0.0",
-    "node-sass": "^4.5.3",
+    "extract-text-webpack-plugin": "^3.0.2",
     "raw-loader": "^0.5.1",
-    "sass-loader": "^6.0.6",
-    "style-loader": "^0.18.2",
-    "webpack": "^3.6.0",
+    "postcss-loader": "^2.0.10",
+    "style-loader": "^0.19.1",
+    "webpack": "^3.10.0",
     "webpack-sources": "1.0.1"
   }
 }
diff --git a/webpack.config.js b/webpack.config.js
index 0a258ef2..c1e24a14 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -7,6 +7,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 BabelMinifyPlugin = require( 'babel-minify-webpack-plugin' );
 const ExtractTextPlugin = require( 'extract-text-webpack-plugin' );
@@ -30,19 +31,24 @@ module.exports = {
                                     use: [ 'raw-loader' ]
                            },
                            {
-                                    test: /\.scss$/,
-                                    use: ExtractTextPlugin.extract( {
-                                             fallback: 'style-loader',
-                                             use: [
-                                                      {
-                                                               loader: 'css-loader',
-                                                               options: {
-                                                                        minimize: true
-                                                               }
-                                                      },
-                                                      'sass-loader'
-                                             ]
-                                    } )
+                                    test: /\.css$/,
+                                    use: [
+                                             {
+                                                      loader: 'style-loader',
+                                                      options: {
+                                                               singleton: true
+                                                      }
+                                             },
+                                             {
+                                                      loader: 'postcss-loader',
+                                                      options: getPostCssConfig( {
+                                                               themeImporter: {
+                                                                        themePath: require.resolve( '@ckeditor/ckeditor5-theme-lark' )
+                                                               },
+                                                               minify: true
+                                                      } )
+                                             },
+                                    ]
                            }
                   ]
          },
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant