@webextension-toolbox/webextension-toolbox
Advanced tools
Comparing version 5.0.1 to 5.1.0
@@ -10,2 +10,11 @@ # Changelog | ||
## [5.0.2] - 2021-04-11 | ||
### Fixed | ||
- Target resolution was incorrect and thus detroying most of the built modules | ||
### Changes | ||
- In the past the `node` option was set to false in webpack config to prevent security issues with usage of eval (See https://github.com/webextension-toolbox/webextension-toolbox/pull/34). This was resolved at the end of life of webpack 4 and does not exist in webpack 5. This option is now set to true by default (not set). This means global is now set by webpack itself. If you want to disable this behavior you can set the `node` option to false in your webpack config. See: https://webpack.js.org/configuration/node/ | ||
- Clean webpack plugin was removed in favor of https://webpack.js.org/guides/output-management/#cleaning-up-the-dist-folder which is native in webpack 5. | ||
## [5.0.1] - 2021-04-06 | ||
@@ -12,0 +21,0 @@ ### Changes |
@@ -8,3 +8,2 @@ "use strict"; | ||
const webpack_1 = require("webpack"); | ||
const clean_webpack_plugin_1 = require("clean-webpack-plugin"); | ||
const webpack_watched_glob_entries_plugin_1 = __importDefault(require("webpack-watched-glob-entries-plugin")); | ||
@@ -49,2 +48,3 @@ const case_sensitive_paths_webpack_plugin_1 = __importDefault(require("case-sensitive-paths-webpack-plugin")); | ||
} | ||
const resolvedTarget = (0, path_1.resolve)(target.replace("[vendor]", vendor)); | ||
const mode = dev ? "development" : "production"; | ||
@@ -99,5 +99,6 @@ // Get some defaults | ||
config.output = { | ||
path: (0, path_1.resolve)(target.replace("[vendor]", vendor)), | ||
path: resolvedTarget, | ||
filename: "[name].js", | ||
chunkFilename: "[id].chunk.js", | ||
clean: true, | ||
}; | ||
@@ -155,4 +156,2 @@ /** *************************** */ | ||
} | ||
// Clear output directory | ||
config.plugins.push(new clean_webpack_plugin_1.CleanWebpackPlugin()); | ||
// Watcher doesn't work well if you mistype casing in a path so we use | ||
@@ -178,3 +177,3 @@ // a plugin that prints an error when you attempt to do this. | ||
}, | ||
to: target, | ||
to: resolvedTarget, | ||
}, | ||
@@ -190,3 +189,3 @@ ]; | ||
from: resolvedFrom, | ||
to: target, | ||
to: resolvedTarget, | ||
}); | ||
@@ -218,13 +217,2 @@ } | ||
} | ||
// Disable webpacks usage of eval & function string constructor | ||
// @url https://github.com/webpack/webpack/blob/master/buildin/global.js | ||
config.node = false; | ||
// In order to still be able to use global we use window instead | ||
/* | ||
config.plugins.push( | ||
new ProvidePlugin({ | ||
global: require.resolve('./utils/global.js') | ||
}) | ||
) | ||
*/ | ||
config.plugins.push(new webpackbar_1.default()); | ||
@@ -231,0 +219,0 @@ return config; |
{ | ||
"name": "@webextension-toolbox/webextension-toolbox", | ||
"version": "5.0.1", | ||
"version": "5.1.0", | ||
"description": "Framework for WebExtensions (Firefox, Chrome, Opera, Edge)", | ||
@@ -45,3 +45,2 @@ "main": "./dist/index.js", | ||
"case-sensitive-paths-webpack-plugin": "^2.4.0", | ||
"clean-webpack-plugin": "^4.0.0", | ||
"commander": "^9.1.0", | ||
@@ -48,0 +47,0 @@ "copy-webpack-plugin": "^10.2.4", |
@@ -15,5 +15,5 @@ [<img align="right" src="./assets/icon.svg?sanitize=true">](https://www.npmjs.com/package/@webextension-toolbox/webextension-toolbox) | ||
- Chrome (`chrome`) (auto [polyfilled](https://github.com/mozilla/webextension-polyfill)) | ||
- Opera (`opera`) (auto [polyfilled](https://github.com/mozilla/webextension-polyfill)) | ||
- Edge (`edge`) (auto [polyfilled](https://github.com/mozilla/webextension-polyfill)) | ||
- Chrome (`chrome`) | ||
- Opera (`opera`) | ||
- Edge (`edge`) | ||
- Firefox (`firefox`) | ||
@@ -44,2 +44,7 @@ - Safari (`safari`) | ||
## Typescript Support | ||
Native typescript support (but not enforced!) | ||
(see section [How do I use Typescript?](#how-do-i-use-typescript)) | ||
## Manifest vendor keys | ||
@@ -49,6 +54,2 @@ | ||
## Typescript Support | ||
Native typescript support (but not enforced!) | ||
### Example | ||
@@ -55,0 +56,0 @@ |
import { resolve } from "path"; | ||
import { Configuration, EnvironmentPlugin } from "webpack"; | ||
import { CleanWebpackPlugin } from "clean-webpack-plugin"; | ||
import GlobEntriesPlugin from "webpack-watched-glob-entries-plugin"; | ||
@@ -78,2 +77,3 @@ import CaseSensitivePathsPlugin from "case-sensitive-paths-webpack-plugin"; | ||
const resolvedTarget = resolve(target.replace("[vendor]", vendor)); | ||
const mode = dev ? "development" : "production"; | ||
@@ -138,5 +138,6 @@ | ||
config.output = { | ||
path: resolve(target.replace("[vendor]", vendor)), | ||
path: resolvedTarget, | ||
filename: "[name].js", | ||
chunkFilename: "[id].chunk.js", | ||
clean: true, | ||
}; | ||
@@ -200,5 +201,2 @@ /** *************************** */ | ||
// Clear output directory | ||
config.plugins.push(new CleanWebpackPlugin()); | ||
// Watcher doesn't work well if you mistype casing in a path so we use | ||
@@ -229,3 +227,3 @@ // a plugin that prints an error when you attempt to do this. | ||
}, | ||
to: target, | ||
to: resolvedTarget, | ||
}, | ||
@@ -242,3 +240,3 @@ ]; | ||
from: resolvedFrom, | ||
to: target, | ||
to: resolvedTarget, | ||
}); | ||
@@ -282,15 +280,2 @@ } | ||
// Disable webpacks usage of eval & function string constructor | ||
// @url https://github.com/webpack/webpack/blob/master/buildin/global.js | ||
config.node = false; | ||
// In order to still be able to use global we use window instead | ||
/* | ||
config.plugins.push( | ||
new ProvidePlugin({ | ||
global: require.resolve('./utils/global.js') | ||
}) | ||
) | ||
*/ | ||
config.plugins.push(new WebpackBar()); | ||
@@ -297,0 +282,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17
255
54425
1162
- Removedclean-webpack-plugin@^4.0.0
- Removed@types/glob@7.2.0(transitive)
- Removed@types/minimatch@5.1.2(transitive)
- Removedarray-union@1.0.2(transitive)
- Removedarray-uniq@1.0.3(transitive)
- Removedclean-webpack-plugin@4.0.0(transitive)
- Removeddel@4.1.1(transitive)
- Removedglobby@6.1.0(transitive)
- Removedis-path-cwd@2.2.0(transitive)
- Removedis-path-in-cwd@2.1.0(transitive)
- Removedis-path-inside@2.1.0(transitive)
- Removedobject-assign@4.1.1(transitive)
- Removedp-map@2.1.0(transitive)
- Removedpath-is-inside@1.0.2(transitive)
- Removedpify@2.3.0(transitive)
- Removedpinkie@2.0.4(transitive)
- Removedpinkie-promise@2.0.1(transitive)
- Removedrimraf@2.7.1(transitive)