Added manifest building.

This commit is contained in:
Ajay Ramachandran
2020-02-04 01:32:58 -05:00
parent da364b49f0
commit 09a33c4252
11 changed files with 173 additions and 91 deletions

View File

@@ -1,9 +1,10 @@
const webpack = require("webpack");
const path = require('path');
const CopyPlugin = require('copy-webpack-plugin');
const BuildManifest = require('./webpack.manifest');
const srcDir = '../src/';
module.exports = {
module.exports = env => ({
entry: {
popup: path.join(__dirname, srcDir + 'popup.ts'),
background: path.join(__dirname, srcDir + 'background.ts'),
@@ -34,11 +35,14 @@ module.exports = {
},
plugins: [
// exclude locale files in moment
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
new CopyPlugin([
{ from: '.', to: '../' }
{ from: '.', to: '../', ignore: ['manifest.json'] }
],
{context: 'public' }
),
new BuildManifest({
browser: env.browser,
pretty: env.mode === "production"
})
]
};
});