From fed6d3f173f9a71c864a36de52f0fc95879f31d0 Mon Sep 17 00:00:00 2001 From: Iskren Stoyanov Date: Mon, 13 Apr 2020 18:47:03 +0300 Subject: [PATCH] migrate webpack.config.js for webpack 4 --- package.json | 2 +- webpack.config.js | 29 ++++++++++++++++++++--------- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index b81e9e7..171c102 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pcloud-sdk-js", - "version": "1.4.3", + "version": "1.4.4", "description": "pCloud's Javascript SDK", "main": "lib/index.js", "types": "./typings/index.d.ts", diff --git a/webpack.config.js b/webpack.config.js index eaff963..bbcc4c1 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -7,19 +7,30 @@ module.exports = { filename: "pcloudsdk.js", library: "pCloudSdk", libraryTarget: "umd", - umdNamedDefine: true + umdNamedDefine: true, }, devtool: "source-map", + mode: "production", module: { - preLoaders: [ { test: /\.js$/, loader: "source-map-loader" } ], - loaders: [ { test: /\.js$/, loader: "babel-loader" } ] + rules: [ + { + test: /\.js$/, + enforce: "pre", + loader: "source-map-loader", + }, + { + test: /\.js$/, + loader: "babel-loader", + }, + ], + }, + resolve: { aliasFields: ["browser"] }, + optimization: { + minimize: true, }, - resolve: { packageAlias: "browser" }, plugins: [ - new webpack.optimize.UglifyJsPlugin(), - new webpack.optimize.DedupePlugin(), new webpack.DefinePlugin({ - ENV: JSON.stringify("web") - }) - ] + ENV: JSON.stringify("web"), + }), + ], };