title: Include extra files inside app.asar using electron
body: <p>It's a Vue app with electron-builder</p>
  
  <pre><code>{
    "scripts": {
      "serve": "vue-cli-service serve",
      "build": "vue-cli-service build",
      "electron:build": "vue-cli-service electron:build",
      "electron:serve": "vue-cli-service electron:serve",
      "postinstall": "electron-builder install-app-deps",
      "postuninstall": "electron-builder install-app-deps",
    },
    "main": "background.js",
    "dependencies": {
      "core-js": "^3.6.5",
      "vue": "^2.6.11",
      "vue-class-component": "^7.2.3",
      "vue-property-decorator": "^8.4.2",
      "vue-router": "^3.3.2",
      "vuetify": "^2.2.33"
    },
    "devDependencies": {
      "@vue/cli-plugin-babel": "~4.4.0",
      "@vue/cli-plugin-eslint": "~4.4.0",
      "@vue/cli-plugin-router": "~4.4.0",
      "@vue/cli-plugin-typescript": "~4.4.0",
      "@vue/cli-service": "~4.4.0",
      "electron": "^6.1.12",
      "typescript": "^3.9.5",
      "vue-cli-plugin-electron-builder": "~1.4.6",
      "vue-cli-plugin-vuetify": "~2.0.5",
      "vue-template-compiler": "^2.6.11",
      "vuetify-loader": "^1.3.0"
    }
  }
  </code></pre>
  
  <p>When I use <code>npm run electron:build</code>, this structure is generated:</p>
  
  <p><a href="https://i.stack.imgur.com/N5rL7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/N5rL7.png" alt="enter image description here"></a></p>
  
  <p>And this is the content of app.asar:</p>
  
  <p><a href="https://i.stack.imgur.com/IcDFz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IcDFz.png" alt="enter image description here"></a></p>
  
  <p>background.js include all the dependencies. There are some external modules (from node_modules) that read files using something like <code>fs.readFile(__dirpath + '/file')</code>. As expected, these files are not included in the generated bundle, so I need to add them.</p>
  
  <p>I've tried to use this in vue.config.js:</p>
  
  <pre><code>module.exports = {
    lintOnSave: true,
    transpileDependencies: [
      'vuetify'
    ],
    configureWebpack: {
      devtool: 'source-map'
    },
    pluginOptions: {
      electronBuilder: {
        builderOptions: {
          extraFiles: [
            'node_modules/module/file'
          ]
        }
      }
    }
  }
  
  </code></pre>
  
  <p>But the file is included outside the app.asar, even with <code>extraResources</code>, and thus <code>fs.readFile(__dirpath + '/file')</code> did not find the file.</p>
  
  <p>How can I include files inside app.asar?</p>