Skip to content

Commit

Permalink
#23 rename extension to dist; separate into dev and prod distributions
Browse files Browse the repository at this point in the history
  • Loading branch information
motorina0 committed Apr 7, 2021
1 parent 34b2e68 commit 665041c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
node_modules/
extension/
dist/
.yarn/
.pnp.js
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ public/
*.scss.map

## Build directory
extension/
dist/
.awcache

Expand Down
9 changes: 6 additions & 3 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 665041c

Please sign in to comment.