Kaynağa Gözat

Replaced webpack-text-extract-plugin with mini-css-extract-plugin.

Maciej Bukowski 7 yıl önce
ebeveyn
işleme
5ef4fb4b42
2 değiştirilmiş dosya ile 16 ekleme ve 17 silme
  1. 1 1
      package.json
  2. 15 16
      scripts/docs/snippetadapter.js

+ 1 - 1
package.json

@@ -72,12 +72,12 @@
     "babel-minify-webpack-plugin": "^0.3.0",
     "eslint": "^4.15.0",
     "eslint-config-ckeditor5": "^1.0.7",
-    "extract-text-webpack-plugin": "^4.0.0-beta.0",
     "glob": "^7.1.2",
     "husky": "^0.14.3",
     "lerna": "^2.2.0",
     "lint-staged": "^7.0.0",
     "mgit2": "^0.8.0",
+    "mini-css-extract-plugin": "^0.2.0",
     "minimatch": "^3.0.4",
     "postcss-loader": "^2.1.1",
     "raw-loader": "^0.5.1",

+ 15 - 16
scripts/docs/snippetadapter.js

@@ -10,7 +10,7 @@ const fs = require( 'fs' );
 const webpack = require( 'webpack' );
 const { bundler, styles } = require( '@ckeditor/ckeditor5-dev-utils' );
 const CKEditorWebpackPlugin = require( '@ckeditor/ckeditor5-dev-webpack-plugin' );
-const ExtractTextPlugin = require( 'extract-text-webpack-plugin' );
+const MiniCssExtractPlugin = require( 'mini-css-extract-plugin' );
 const BabelMinifyPlugin = require( 'babel-minify-webpack-plugin' );
 
 const webpackProcesses = new Map();
@@ -80,7 +80,7 @@ module.exports = function snippetAdapter( data ) {
 
 function getWebpackConfig( config ) {
 	const plugins = [
-		new ExtractTextPlugin( 'snippet.css' ),
+		new MiniCssExtractPlugin( { filename: 'snippet.css' } ),
 		new CKEditorWebpackPlugin( {
 			language: config.language || 'en'
 		} ),
@@ -134,20 +134,19 @@ function getWebpackConfig( config ) {
 				},
 				{
 					test: /\.css$/,
-					use: ExtractTextPlugin.extract( {
-						fallback: 'style-loader',
-						use: [
-							{
-								loader: 'postcss-loader',
-								options: styles.getPostCssConfig( {
-									themeImporter: {
-										themePath: require.resolve( '@ckeditor/ckeditor5-theme-lark' )
-									},
-									minify: config.production
-								} )
-							}
-						]
-					} )
+					use: [
+						MiniCssExtractPlugin.loader,
+						'css-loader',
+						{
+							loader: 'postcss-loader',
+							options: styles.getPostCssConfig( {
+								themeImporter: {
+									themePath: require.resolve( '@ckeditor/ckeditor5-theme-lark' )
+								},
+								minify: config.production
+							} )
+						}
+					]
 				}
 			]
 		}