adambullmer / vue-cli-plugin-browser-extension

Browser extension development plugin for vue-cli 3.0
GNU Lesser General Public License v3.0
425 stars 76 forks source link

Output background.js in /dist/background.js #116

Open leoplct opened 3 years ago

leoplct commented 3 years ago

According to manifest V3 background.js must be placed in root (./background.js).

I tried to changed vue.config.js as below but the output key is ignored.

const p = require('path');

pluginOptions: {
    browserExtension: {
      components: {
        background: true,
        contentScripts: true
      },
      componentOptions: {
        background: {
          entry: './src/background.js',
          output: {
            filename: 'background.js', path: p.resolve(__dirname, 'dist')
          }
        },
leoplct commented 3 years ago

I have solved moving background.js to /public/background.js but I don't know if this is a good practice.

leodev87 commented 2 years ago

still needed

cbs8710064 commented 1 year ago

我已经解决了将 background.js 移动到 /public/background.js 的问题,但我不知道这是否是一个好习惯。

How did you solve it?