From 665041cb0a774f6fa1a1296a51d9be5042863ef0 Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Wed, 7 Apr 2021 10:27:27 +0300 Subject: [PATCH] #23 rename extension to dist; separate into dev and prod distributions --- .eslintignore | 2 +- .gitignore | 1 - webpack.config.js | 9 ++++++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.eslintignore b/.eslintignore index 92479eacbe..782b8b68e2 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,4 +1,4 @@ node_modules/ -extension/ +dist/ .yarn/ .pnp.js \ No newline at end of file diff --git a/.gitignore b/.gitignore index 57da7f390b..d70c267359 100644 --- a/.gitignore +++ b/.gitignore @@ -101,7 +101,6 @@ public/ *.scss.map ## Build directory -extension/ dist/ .awcache diff --git a/webpack.config.js b/webpack.config.js index dbb8c31119..30a0c5fe05 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -12,8 +12,9 @@ const OptimizeCSSAssetsPlugin = require("optimize-css-assets-webpack-plugin"); const viewsPath = path.join(__dirname, "views"); const sourcePath = path.join(__dirname, "src"); -const destPath = path.join(__dirname, "extension"); const nodeEnv = process.env.NODE_ENV || "development"; +const destPath = path.join(__dirname, "dist", nodeEnv); + const targetBrowser = process.env.TARGET_BROWSER; const extensionReloaderPlugin = @@ -145,10 +146,12 @@ module.exports = { // delete previous build files new CleanWebpackPlugin({ cleanOnceBeforeBuildPatterns: [ - path.join(process.cwd(), `extension/${targetBrowser}`), + path.join(process.cwd(), "dist", nodeEnv, targetBrowser), path.join( process.cwd(), - `extension/${targetBrowser}.${getExtensionFileType(targetBrowser)}` + "dist", + nodeEnv, + `${targetBrowser}.${getExtensionFileType(targetBrowser)}` ), ], cleanStaleWebpackAssets: false,