diff options
author | Florian Dold <florian.dold@gmail.com> | 2020-04-06 21:05:51 +0530 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2020-04-06 21:05:51 +0530 |
commit | 07f25566ca51b7faf6462a57d15f4ebbfc733ab0 (patch) | |
tree | 04e03d831adae4c00ac6a6a19706de4ed6ad7dd3 /webpack.config.js | |
parent | 13bccc7bd982da58738dfd63a2493e476d596161 (diff) |
start spring cleaning, use rollup instead of both webpack and rollup
Diffstat (limited to 'webpack.config.js')
-rw-r--r-- | webpack.config.js | 111 |
1 files changed, 0 insertions, 111 deletions
diff --git a/webpack.config.js b/webpack.config.js deleted file mode 100644 index 15e60c1eb..000000000 --- a/webpack.config.js +++ /dev/null @@ -1,111 +0,0 @@ -const path = require('path'); -const webpack = require('webpack'); -const merge = require('webpack-merge'); -const { CheckerPlugin } = require('awesome-typescript-loader') -const TerserPlugin = require('terser-webpack-plugin'); - - -function externalsCb(context, request, callback) { - if (/.*taler-emscripten-lib.*/.test(request)) { - callback(null, "undefined"); - return; - } - callback(); -} - -module.exports = function (env) { - env = env || {}; - const base = { - output: { - filename: '[name]-bundle.js', - chunkFilename: "[name]-bundle.js", - path: path.resolve(__dirname, "dist"), - }, - module: { - noParse: /taler-emscripten-lib/, - rules: [ - { - test: /\.tsx?$/, - loader: 'awesome-typescript-loader', - exclude: /node_modules|taler-emscripten-lib|nodeEmscriptenLoader|synchronousWorker/, - } - ] - }, - resolve: { - modules: [path.resolve(__dirname, "./"), "node_modules"], - extensions: [".tsx", ".ts", ".js"] - }, - plugins: [ - new CheckerPlugin(), - ], - devtool: "source-map", - externals: [ - externalsCb, - "child_process", - ], - optimization: { - minimize: false, - minimizer: [ - new TerserPlugin({ - sourceMap: true, - terserOptions: { - keep_classnames: true, - keep_fnames: true, - } - }), - ], - } - } - const configWebWorker = { - entry: {"cryptoWorker": "./src/crypto/workers/browserWorkerEntry.ts"}, - target: "webworker", - name: "webworker", - }; - - const configBackground = { - entry: {"background": "./src/webex/background.ts"}, - name: "background", - }; - - const configContentScript = { - entry: {"contentScript": "./src/webex/notify.ts"}, - name: "contentScript", - }; - - const configExtensionPages = { - entry: { - "add-auditor": "./src/webex/pages/add-auditor.tsx", - "auditors": "./src/webex/pages/auditors.tsx", - "benchmark": "./src/webex/pages/benchmark.tsx", - "pay": "./src/webex/pages/pay.tsx", - "withdraw": "./src/webex/pages/withdraw.tsx", - "welcome": "./src/webex/pages/welcome.tsx", - "payback": "./src/webex/pages/payback.tsx", - "popup": "./src/webex/pages/popup.tsx", - "reset-required": "./src/webex/pages/reset-required.tsx", - "return-coins": "./src/webex/pages/return-coins.tsx", - "refund": "./src/webex/pages/refund.tsx", - "show-db": "./src/webex/pages/show-db.ts", - "tip": "./src/webex/pages/tip.tsx", - }, - name: "pages", - optimization: { - splitChunks: { - cacheGroups: { - commons: { - name: 'page-common', - chunks: 'all', - minChunks: 2, - }, - }, - }, - }, - }; - - return [ - merge(base, configBackground), - merge(base, configWebWorker), - merge(base, configExtensionPages), - merge(base, configContentScript) - ]; -} |