Bump copy-webpack-plugin from 5.1.1 to 6.0.2 (#160)

* Bump copy-webpack-plugin from 5.1.1 to 6.0.2

Bumps [copy-webpack-plugin](https://github.com/webpack-contrib/copy-webpack-plugin) from 5.1.1 to 6.0.2.
- [Release notes](https://github.com/webpack-contrib/copy-webpack-plugin/releases)
- [Changelog](https://github.com/webpack-contrib/copy-webpack-plugin/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack-contrib/copy-webpack-plugin/compare/v5.1.1...v6.0.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Update copy-webpack-plugin

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Manuel Bouza <manuel@bouza.ch>
This commit is contained in:
dependabot-preview[bot]
2020-06-04 23:29:06 +02:00
committed by GitHub
parent 5311e6ea2f
commit 97e47ad769
3 changed files with 297 additions and 129 deletions

View File

@@ -4,44 +4,42 @@ const { compact } = require("lodash/fp")
const baseConfig = require("./webpack.base.config")
module.exports = env => {
module.exports = (env) => {
const config = baseConfig(env)
config.plugins.unshift(
new CopyWebpackPlugin([
{
from: "src/manifest.json",
transform: function(content, _path) {
const manifest = JSON.parse(
content
.toString()
.replace(/\[version\]/g, process.env.npm_package_version)
)
return Buffer.from(
JSON.stringify({
...manifest,
permissions: compact([
...manifest.permissions,
env.NODE_ENV === "development"
? "http://*.mocoapp.localhost/*"
: null
]),
options_ui: {
...manifest.options_ui,
browser_style: true
},
browser_specific_settings: {
gecko: {
id: process.env.APPLICATION_ID || `{${uuidv4()}}`
}
},
description: process.env.npm_package_description,
version: process.env.npm_package_version
})
)
}
}
])
new CopyWebpackPlugin({
pattern: [
{
from: "src/manifest.json",
transform: function (content, _path) {
const manifest = JSON.parse(
content.toString().replace(/\[version\]/g, process.env.npm_package_version),
)
return Buffer.from(
JSON.stringify({
...manifest,
permissions: compact([
...manifest.permissions,
env.NODE_ENV === "development" ? "http://*.mocoapp.localhost/*" : null,
]),
options_ui: {
...manifest.options_ui,
browser_style: true,
},
browser_specific_settings: {
gecko: {
id: process.env.APPLICATION_ID || `{${uuidv4()}}`,
},
},
description: process.env.npm_package_description,
version: process.env.npm_package_version,
}),
)
},
},
],
}),
)
return config