const path = require('path'); const CopyPlugin = require('copy-webpack-plugin'); module.exports = { mode: 'production', entry: { popup: './js/popup.js', content: './content.js', background: './background.js', options: './js/options.js', annotator: './js/annotator.js', annotation: './js/annotation.js', 'screenshot-editor': './js/screenshot-editor.js', 'editor-init': './js/editor-init.js' }, output: { filename: '[name].js', path: path.resolve(__dirname, 'dist'), clean: true }, module: { rules: [ { test: /\.js$/, exclude: /node_modules/, use: { loader: 'babel-loader', options: { presets: [ ['@babel/preset-env', { targets: { chrome: "58" } }] ], plugins: ['@babel/plugin-transform-runtime'] } } } ] }, plugins: [ new CopyPlugin({ patterns: [ { from: "manifest.json", to: "manifest.json" }, { from: "*.html", to: "[name][ext]" }, { from: "*.css", to: "[name][ext]" }, { from: "styles/*.css", to: "styles/[name][ext]" }, { from: "assets", to: "assets" } ], }), ], resolve: { extensions: ['.js'], fallback: { "path": false, "fs": false } }, optimization: { minimize: false // Disable minification for debugging } };