"You may need appropriate loader to handle this file type"

Hi!
In /src/background.js I have:

import createApplicationMenu from './services/electron-services/menus/application-menu';

/src/services/electron-services/menus$ ls -lah
total 16K
drwxr-xr-x 2 marco marco 4,0K giu 21 18:22 .
drwxr-xr-x 3 marco marco 4,0K giu 21 17:28 ..
-rw-r--r-- 1 marco marco  348 giu 21 18:22 application-menu.js
-rwxr-xr-x 1 marco marco   21 giu 21 18:22 package.json

package.json :

{ "type": "module" }

application-menu.js :

import { app, BrowserWindow, dialog, Menu, shell } from 'electron';
import mainProcess from '@/background';

const createApplicationMenu = () => {

};

export createApplicationMenu;

Executing yarn electron:serve I get this error message:

(base) marco@pc01:~/webMatters/vueMatters/GGC$ yarn electron:serve
yarn run v1.22.4
$ vue-cli-service electron:serve
 INFO  Starting development server...
98% after emitting CopyPlugin

 WARNING  Compiled with 2 warnings                                                               6:34:37 PM

 warning  in ./node_modules/gun/sea.js

Critical dependency: the request of a dependency is an expression

 warning  in ./node_modules/gun/gun.js

Critical dependency: the request of a dependency is an expression


  App running at:
  - Local:   http://localhost:8080 
  - Network: http://ggc.world/

  Note that the development build is not optimized.
  To create a production build, run yarn build.

⠧  Bundling main process...

 ERROR  Failed to compile with 1 errors                                                          6:34:38 PM

 error  in ./src/services/electron-services/menus/application-menu.js

Module parse failed: Unexpected token (13:7)
You may need an appropriate loader to handle this file type, currently no loaders are configured to 
process this file. See https://webpack.js.org/concepts#loaders
| };
| 
> export createApplicationMenu;
| 

 @ ./src/background.js 16:0-88
 @ multi ./src/background.js

 ERROR  Build failed with errors.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

But if I execute ‘npm run serve’ I do not get any error messages:

(base) marco@pc01:~/webMatters/vueMatters/GGC$ npm run serve

> ggc.world@0.1.0 serve /home/marco/webMatters/vueMatters/GGC
> vue-cli-service serve

 INFO  Starting development server...
98% after emitting CopyPlugin

 WARNING  Compiled with 2 warnings                                                                                6:36:57 PM

 warning  in ./node_modules/gun/sea.js

Critical dependency: the request of a dependency is an expression

 warning  in ./node_modules/gun/gun.js

Critical dependency: the request of a dependency is an expression

  App running at:
  - Local:   http://localhost:8080 
  - Network: http://ggc.world/

  Note that the development build is not optimized.
  To create a production build, run yarn build.

This is the entire webpack.config.js :

import 'script-loader!./script.js';

var nodeExternals = require('webpack-node-externals');
module.exports = [{
    "mode": "development",
    plugins: [
      new webpack.IgnorePlugin(/^pg-native$/, /^dns$, /^uws$)
      })
    ],
    "output": {
        "path": __dirname+'/static',
        "filename": "[name].[chunkhash:8].js"
    },
    "module": {
        "rules": [
            {
                "test": /\.vue$/,
                "exclude": /node_modules/,
                "use": "vue-loader"
            },
            {
                "test": /\.pem$/,
                "use": "file-loader"
            }
        ],
        "rules": [
            {
                "test": /uws.js$/,
                "use": [
                    {
                        "loader": "val-loader",
                    }
                ]
            }
        ],
        "rules": [
            {
                 "test": /\.s(c|a)ss$/,
                 "use": [
                   "vue-style-loader",
                   "css-loader",
                   {
                     "loader": "sass-loader",
                     // Requires sass-loader@^7.0.0
                     "options": {
                       "implementation": require("sass"),
                       "fiber": require("fibers"),
                       "indentedSyntax": "true" // optional
                     },
                     // Requires sass-loader@^8.0.0
                     "options": {
                       "implementation": require("sass"),
                       "sassOptions": {
                         "fiber": require("fibers"),
                         "indentedSyntax": "true" // optional
                       },
                     },
                   },
                 ],
            },
        ]
    },
    node: {
        __dirname: false,
        __filename: false
    },
    resolve: {
        extension: ["*", ".pem"],
    },
    devServer: {
        watchOptions: {
            aggregateTimeout: 300,
            poll: 1000
        },
        https: true,
        compress: true,
        public: "ggc.world:8080"
    }
}]

module.exports = [{
  target: 'node', // in order to ignore built-in modules like path, fs, etc.
  externals: {
    nodeExternals: 'nodeExternals()' // in order to ignore all modules in node_modules folder
  },
  externals: [{
    'peerjs': 'peerjs',
    'sequelize': 'sequelize'
  }],
  externals: [
    ...Object.keys(dependencies || {},
    {'peerjs': 'peerjs'} 
  ]
}];

const path = require('path');

module.exports = [{
  entry: {
    app: ['./lib/main.js'],
  },
  output: {
    path: path.resolve(__dirname, 'build'),
    publicPath: '/assets/',
    filename: 'bundle.js',
  },
  devtool: 'inline-source-map',
  module: {
    rules: [{
      test: /.js?$/,
      exclude: /(node_modules|bower_components)/,
      loader: 'babel-loader',
      options : {
        presets: [
          "es2017"
        ]
      }
    }, {
      test: /.json$/,
      loader: 'json-loader',
    }, {
      test: /.css$/,
      loader: 'style-loader!css-loader',
    }],
  },
}]

module.exports = {
  resolve: {
    alias: {
      // If using the runtime only build
      vue$: 'vue/dist/vue.runtime.esm.js' // 'vue/dist/vue.runtime.common.js' for webpack 1
      // Or if using full build of Vue (runtime + compiler)
      // vue$: 'vue/dist/vue.esm.js'      // 'vue/dist/vue.common.js' for webpack 1
    }
  }
}

module.exports = {
  entry: './src/main.js',
  output: {
    filename: 'bundle.js',
    path: path.resolve(__dirname, 'dist'),
  },
  module: {
    rules: [
      {
        test: /\.css$/,
        use: [
          'style-loader',
          'css-loader',
        ],
      },
    ],
  },
};

module.exports = {
  module: {
    rules: [
      {
        test: /\.(png|jpe?g|gif|js)$/i,
        use: [
          {
            loader: 'file-loader',
          },
        ],
      },
    ],
  },
};

How to solve the problem?
Looking forward to your kind help.
Marco

It was a silly mistake, and gott confused by the error messages of the output.

Solved with export const createApplicationMenu