wpatter6 / clickr

Clickr is a remote control app and browser extension that gives you control over your browser from your android or iOS device.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

post the source for the browser extension?

kinghat opened this issue · comments

im trying to look and see how you setup vue.config.js to scaffold out dist/.

commented

I'm not ready to make the full source public, but I'll share the vue.config.js:

vue.config.js:

module.exports = {
  pages: {
    options: {
      entry: "src/options/main.ts",
      template: "public/options.html"
    },
    popup: {
      entry: "src/popup/main.ts",
      template: "public/popup.html"
    },
    background: {
      entry: "src/background/main.ts"
    },
    content: {
      entry: "src/content/main.ts"
    }
  },
  chainWebpack: config => {
    config.optimization.delete("splitChunks");
  },
  filenameHashing: false
};

It outputs to the /js/ folder in dist a .js file corresponding to each of the pages nodes.

I'm not ready to make the full source public, but I'll share the vue.config.js:

It outputs to the /js/ folder in dist a .js file corresponding to each of the pages nodes.

tyvm. do you have an email or better chat medium for easier communication?

so after some playing if you dont want html files generated for certain entries you can do something like this:

const pages = {
  "popup/popup": {
    entry: "src/popup/popup.js",
    template: "src/popup/popup.html",
  },
  background: {
    entry: "src/background.js",
  },
  "content-scripts/content-script": {
    entry: "src/content-scripts/content-script.js",
  },
};

module.exports = {
  pages,
  chainWebpack: config => {
    Object.keys(pages).forEach(page => {
      if (page !== "popup/popup") {
        config.plugins.delete(`html-${page}`);
        config.plugins.delete(`preload-${page}`);
        config.plugins.delete(`prefetch-${page}`);
      }
    });
    // OR something more static like:
    // config.plugins.delete("html-background");
    // config.plugins.delete("html-content-scripts/content-script");
    config.optimization.delete("splitChunks");
  },
  configureWebpack: (config, options) => {
    config.output.filename = "[name].js";
    config.output.chunkFilename = "js/[id].[name].js";
  },
commented

Interesting, thank you.