Update webpack config

This commit is contained in:
Manuel Bouza
2019-02-21 16:58:55 +01:00
parent 0c07baa598
commit 3c5c31facd
3 changed files with 30 additions and 8 deletions

View File

@@ -1,7 +1,7 @@
{ {
"name": "moco-browser-extensions", "name": "moco-browser-extensions",
"description": "Browser plugin for MOCO", "description": "Browser plugin for MOCO",
"version": "0.9.20", "version": "1.0.0",
"main": "bundle.js", "main": "bundle.js",
"scripts": { "scripts": {
"start": "node_modules/.bin/webpack --watch --env.NODE_ENV development", "start": "node_modules/.bin/webpack --watch --env.NODE_ENV development",
@@ -54,6 +54,7 @@
"style-loader": "^0.23.1", "style-loader": "^0.23.1",
"webpack": "^4.15.0", "webpack": "^4.15.0",
"webpack-bugsnag-plugins": "^1.3.0", "webpack-bugsnag-plugins": "^1.3.0",
"webpack-cli": "^3.0.8" "webpack-cli": "^3.0.8",
"zip-webpack-plugin": "^3.0.0"
} }
} }

View File

@@ -3,7 +3,8 @@ const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const CleanWebpackPlugin = require('clean-webpack-plugin') const CleanWebpackPlugin = require('clean-webpack-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin') const HtmlWebpackPlugin = require('html-webpack-plugin')
const CopyWebpackPlugin = require('copy-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 => { module.exports = env => {
const config = { const config = {
@@ -57,7 +58,7 @@ module.exports = env => {
filename: '[name].css', filename: '[name].css',
chunkFilename: '[id].css' chunkFilename: '[id].css'
}), }),
new CleanWebpackPlugin(['build']), new CleanWebpackPlugin(['build/chrome']),
new CopyWebpackPlugin([ new CopyWebpackPlugin([
{ {
from: 'src/manifest.json', from: 'src/manifest.json',
@@ -98,15 +99,15 @@ module.exports = env => {
config.devtool = 'source-map' config.devtool = 'source-map'
config.plugins.push( config.plugins.push(
new ZipPlugin({
filename: 'moco-browser-extension.zip',
exclude: [/\.map$/]
}),
new BugsnagBuildReporterPlugin({ new BugsnagBuildReporterPlugin({
apiKey: 'da6caac4af70af3e4683454b40fe5ef5', apiKey: 'da6caac4af70af3e4683454b40fe5ef5',
appVersion: process.env.npm_package_version, appVersion: process.env.npm_package_version,
releaseStage: 'production' releaseStage: 'production'
}), }),
new BugsnagSourceMapUploaderPlugin({
apiKey: 'da6caac4af70af3e4683454b40fe5ef5',
appVersion: process.env.npm_package_version
}),
) )
} }

View File

@@ -1499,6 +1499,11 @@ bser@^2.0.0:
dependencies: dependencies:
node-int64 "^0.4.0" 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: buffer-from@^1.0.0:
version "1.1.1" version "1.1.1"
resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" 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" which-module "^1.0.0"
y18n "^3.2.1" y18n "^3.2.1"
yargs-parser "^5.0.0" 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"