From 3c5c31facd79a55547a81b2ccfa995190cd6a67a Mon Sep 17 00:00:00 2001 From: Manuel Bouza Date: Thu, 21 Feb 2019 16:58:55 +0100 Subject: [PATCH] Update webpack config --- package.json | 5 +++-- webpack.config.js | 13 +++++++------ yarn.lock | 20 ++++++++++++++++++++ 3 files changed, 30 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 3ada377..79ae3bd 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "moco-browser-extensions", "description": "Browser plugin for MOCO", - "version": "0.9.20", + "version": "1.0.0", "main": "bundle.js", "scripts": { "start": "node_modules/.bin/webpack --watch --env.NODE_ENV development", @@ -54,6 +54,7 @@ "style-loader": "^0.23.1", "webpack": "^4.15.0", "webpack-bugsnag-plugins": "^1.3.0", - "webpack-cli": "^3.0.8" + "webpack-cli": "^3.0.8", + "zip-webpack-plugin": "^3.0.0" } } diff --git a/webpack.config.js b/webpack.config.js index 2de3643..cd1475b 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -3,7 +3,8 @@ const MiniCssExtractPlugin = require('mini-css-extract-plugin') const CleanWebpackPlugin = require('clean-webpack-plugin') const HtmlWebpackPlugin = require('html-webpack-plugin') const CopyWebpackPlugin = require('copy-webpack-plugin') -const { BugsnagBuildReporterPlugin, BugsnagSourceMapUploaderPlugin } = require('webpack-bugsnag-plugins') +var ZipPlugin = require('zip-webpack-plugin') +const { BugsnagBuildReporterPlugin } = require('webpack-bugsnag-plugins') module.exports = env => { const config = { @@ -57,7 +58,7 @@ module.exports = env => { filename: '[name].css', chunkFilename: '[id].css' }), - new CleanWebpackPlugin(['build']), + new CleanWebpackPlugin(['build/chrome']), new CopyWebpackPlugin([ { from: 'src/manifest.json', @@ -98,15 +99,15 @@ module.exports = env => { config.devtool = 'source-map' config.plugins.push( + new ZipPlugin({ + filename: 'moco-browser-extension.zip', + exclude: [/\.map$/] + }), new BugsnagBuildReporterPlugin({ apiKey: 'da6caac4af70af3e4683454b40fe5ef5', appVersion: process.env.npm_package_version, releaseStage: 'production' }), - new BugsnagSourceMapUploaderPlugin({ - apiKey: 'da6caac4af70af3e4683454b40fe5ef5', - appVersion: process.env.npm_package_version - }), ) } diff --git a/yarn.lock b/yarn.lock index b4db853..ade5b6d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1499,6 +1499,11 @@ bser@^2.0.0: dependencies: node-int64 "^0.4.0" +buffer-crc32@~0.2.3: + version "0.2.13" + resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242" + integrity sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI= + buffer-from@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" @@ -7756,3 +7761,18 @@ yargs@^7.0.0: which-module "^1.0.0" y18n "^3.2.1" yargs-parser "^5.0.0" + +yazl@^2.4.3: + version "2.5.1" + resolved "https://registry.yarnpkg.com/yazl/-/yazl-2.5.1.tgz#a3d65d3dd659a5b0937850e8609f22fffa2b5c35" + integrity sha512-phENi2PLiHnHb6QBVot+dJnaAZ0xosj7p3fWl+znIjBDlnMI2PsZCJZ306BPTFOaHf5qdDEI8x5qFrSOBN5vrw== + dependencies: + buffer-crc32 "~0.2.3" + +zip-webpack-plugin@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/zip-webpack-plugin/-/zip-webpack-plugin-3.0.0.tgz#63b3c173f1a87a006915cd7328a3c40b44dc8e32" + integrity sha512-5kNvPv+TUP3JqKWQUXj0vTgXHIRQpYw5YyBUVXQ0pumTAK+a4OZ+eXDHnh44nyr9B1XJQZq9WtSSm5j6NQhjWQ== + dependencies: + webpack-sources "^1.1.0" + yazl "^2.4.3"