Răsfoiți Sursa

Upgraded webpack to 4.1.0. WIP.

Maciej Bukowski 8 ani în urmă
părinte
comite
5571089698
2 a modificat fișierele cu 12 adăugiri și 7 ștergeri
  1. 3 4
      package.json
  2. 9 3
      scripts/docs/snippetadapter.js

+ 3 - 4
package.json

@@ -72,19 +72,18 @@
     "babel-minify-webpack-plugin": "^0.3.0",
     "eslint": "^4.15.0",
     "eslint-config-ckeditor5": "^1.0.7",
-    "extract-text-webpack-plugin": "^3.0.2",
+    "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",
     "minimatch": "^3.0.4",
-    "postcss-loader": "^2.0.10",
+    "postcss-loader": "^2.1.1",
     "raw-loader": "^0.5.1",
     "style-loader": "^0.20.3",
     "umberto": "^0.6.0",
-    "webpack": "^3.11.0",
-    "webpack-sources": "1.0.1"
+	"webpack": "^4.1.0"
   },
   "engines": {
     "node": ">=6.0.0",

+ 9 - 3
scripts/docs/snippetadapter.js

@@ -27,7 +27,7 @@ module.exports = function snippetAdapter( data ) {
 		entry: data.snippetSource.js,
 		outputPath,
 		language: snippetConfig.language,
-		minify: data.options.production
+		production: data.options.production
 	} );
 
 	let promise;
@@ -90,7 +90,7 @@ function getWebpackConfig( config ) {
 		} )
 	];
 
-	if ( config.minify ) {
+	if ( config.production ) {
 		plugins.push(
 			new BabelMinifyPlugin( null, {
 				comments: false
@@ -99,6 +99,12 @@ function getWebpackConfig( config ) {
 	}
 
 	return {
+		mode: config.production ? 'production' : 'development',
+
+		optimization: {
+			minimize: false
+		},
+
 		devtool: 'source-map',
 
 		entry: config.entry,
@@ -137,7 +143,7 @@ function getWebpackConfig( config ) {
 									themeImporter: {
 										themePath: require.resolve( '@ckeditor/ckeditor5-theme-lark' )
 									},
-									minify: config.minify
+									minify: config.production
 								} )
 							}
 						]