diff options
author | Dmitrii Selivanov <selivano.d@gmail.com> | 2021-12-19 03:12:11 +0300 |
---|---|---|
committer | Dmitrii Selivanov <selivano.d@gmail.com> | 2021-12-19 03:12:11 +0300 |
commit | d13aa3f0511659cff9278431758958ba9e20bd71 (patch) | |
tree | 4f61ebc2d8c294048d4be57a3e74e85c25023efd /webpack.config.js | |
parent | 96f063838d220a8ccf20292cf8d64de57353e862 (diff) |
Webpack fixes, build now builds both FF and chrome versions
Diffstat (limited to 'webpack.config.js')
-rw-r--r-- | webpack.config.js | 58 |
1 files changed, 51 insertions, 7 deletions
diff --git a/webpack.config.js b/webpack.config.js index 9452fa7..85aef92 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,13 +1,57 @@ -const path = require("path"); +const path = require('path'); +const CopyPlugin = require('copy-webpack-plugin'); module.exports = { - entry: path.join(__dirname, "./Extensions/combined/ryd.content-script.js"), + entry: path.join(__dirname, './Extensions/combined/ryd.content-script.js'), output: { - filename: "bundled-content-script.js", - path: path.resolve(__dirname, "Extensions/combined"), + filename: 'bundled-content-script.js', + path: path.resolve(__dirname, 'Extensions/combined') }, - externals: { - ramda: "R", + optimization: { + minimize: false }, - module: {}, + module: { + rules: [ + { + test: /\.m?js$/, + exclude: /(node_modules|bower_components)/, + use: { + loader: 'babel-loader', + options: { + presets: ['@babel/preset-env'], + plugins: ['@babel/plugin-proposal-object-rest-spread'] + } + } + } + ] + }, + plugins: [ + // exclude locale files in moment + new CopyPlugin({ + patterns: [ + { + from: './Extensions/combined', + to: './dist/chrome', + globOptions: { + ignore: ['**/manifest-**', '**/dist/**', '**/src/**','**/ryd.content-script.js'] + } + }, + { + from: './Extensions/combined/manifest-chrome.json', + to: './dist/chrome/manifest.json' + }, + { + from: './Extensions/combined', + to: './dist/firefox', + globOptions: { + ignore: ['**/manifest-**', '**/dist/**', '**/src/**','**/ryd.content-script.js'] + } + }, + { + from: './Extensions/combined/manifest-firefox.json', + to: './dist/firefox/manifest.json' + } + ] + }) + ] }; |