Skip to content

Commit

Permalink
migrate webpack.config.js for webpack 4
Browse files Browse the repository at this point in the history
  • Loading branch information
sich committed Apr 13, 2020
1 parent aaf6f07 commit fed6d3f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
29 changes: 20 additions & 9 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
}),
],
};

0 comments on commit fed6d3f

Please sign in to comment.