From d409064bb9e007d9bb0580c5050de96db9dff05c Mon Sep 17 00:00:00 2001 From: Riana Ralambomanana Date: Fri, 10 Jun 2022 10:26:48 +0200 Subject: [PATCH 1/2] Fix Webpack 5 plugin api call --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 80e87b8..57b947a 100644 --- a/index.js +++ b/index.js @@ -39,7 +39,7 @@ function Plugin(options) { Plugin.prototype.apply = function(compiler) { var self = this; self.logger = compiler.getInfrastructureLogger('crx-webpack-plugin'); - return compiler.plugin('done', function() { + return compiler.hooks.done.tap('crx-webpack-plugin', function() { self.package.call(self); }); } From c25d09e0f1dfb584668a3d2da80ef90994ee6d8b Mon Sep 17 00:00:00 2001 From: Riana Ralambomanana Date: Fri, 10 Jun 2022 10:34:04 +0200 Subject: [PATCH 2/2] Update Readme --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index b91b46a..0a7a9e5 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ A webpack plugin to package chrome extensions (crx) post build ## Usage +### Update webpack.config.js ``` javascript var Crx = require("crx-webpack-plugin"); module.exports = { @@ -17,6 +18,19 @@ module.exports = { } ``` +### Create pem file +Package the extension manually from chrome: + +1. Bring up the Extensions management page by going to this URL: chrome://extensions +2. If Developer mode has a + by it, click the +. +Click the Pack extension button. A dialog appears. +3. In the Extension root directory field, specify the path to the extension's folder — for example, c:\myext. (Ignore the other field; you don't specify a private key file the first time you package a particular extension.) +4. Click OK. The packager creates two files: a .crx file, which is the actual extension that can be installed, and a .pem file, which contains the private key. + +Warning: **Do not lose the private key! Keep the .pem file secret and in a safe place.** You'll need it later if you want to update the extension or upload the extension using the Chrome Developer Dashboard + + + ## License MIT (http://www.opensource.org/licenses/mit-license.php)