Greetings!
I can’t understand, what am I doing wrong???
{
"name": "k6-test",
"version": "1.0.0",
"main": "src/main.js",
"devDependencies": {
"@babel/core": "^7.14.6",
"@babel/plugin-transform-block-scoping": "^7.14.5",
"@babel/plugin-transform-classes": "^7.14.5",
"@babel/preset-env": "^7.14.7",
"babel-loader": "^8.2.2",
"prettier": "2.3.2",
"webpack": "^5.40.0",
"webpack-cli": "^4.7.2"
},
"scripts": {
"webpack": "webpack",
"test": "echo \"Error: no test specified\" && exit 1"
}
}
{
"presets": [
[
"@babel/preset-env"
]
],
"plugins": [
"@babel/plugin-transform-block-scoping",
"@babel/plugin-transform-classes"
]
}
var path = require("path");
var webpack = require("webpack");
module.exports = {
mode: "production",
entry: "./src/main.js",
output: {
path: path.resolve(__dirname, "build"),
libraryTarget: "commonjs",
filename: "app.bundle.js",
},
module: {
rules: [
{
test: /\.js$/,
loader: "babel-loader",
},
],
},
stats: {
colors: true,
},
target: ["web", "es5"],
externals: /^(k6|https?\:\/\/)(\/.*)?/,
devtool: "source-map",
};
asinotov@fedora ➜ k6-test git:(k6) ✗ npm run-script webpack && k6 run --compatibility-mode=base build/app.bundle.js
> k6-test@1.0.0 webpack
> webpack
asset app.bundle.js 4.07 KiB [compared for emit] [minimized] (name: main) 1 related asset
orphan modules 5.87 KiB [orphan] 9 modules
runtime modules 997 bytes 4 modules
./src/main.js + 9 modules 7.14 KiB [not cacheable] [built] [code generated]
webpack 5.41.1 compiled successfully in 719 ms
/\ |‾‾| /‾‾/ /‾‾/
/\ / \ | |/ / / /
/ \/ \ | ( / ‾‾\
/ \ | |\ \ | (‾) |
/ __________ \ |__| \__\ \_____/ .io
ERRO[0000] https://jslib.k6.io/k6-utils/1.1.0/index.js: Line 2:1 Unexpected reserved word,https://jslib.k6.io/k6-utils/1.1.0/index.js: Line 3:3 Unexpected token return,https://jslib.k6.io/k6-utils/1.1.0/index.js: Line 9:1 Unexpected reserved word,https://jslib.k6.io/k6-utils/1.1.0/index.js: Line 9:8 Unexpected token function,https://jslib.k6.io/k6-utils/1.1.0/index.js: Line 9:44 Unexpected token {,https://jslib.k6.io/k6-utils/1.1.0/index.js: Line 10:3 Illegal return statement,https://jslib.k6.io/k6-utils/1.1.0/index.js: Line 14:3 Illegal return statement,https://jslib.k6.io/k6-utils/1.1.0/index.js: Line 21:3 Illegal return statement,https://jslib.k6.io/k6-utils/1.1.0/index.js: Line 27:5 Illegal return statement,https://jslib.k6.io/k6-utils/1.1.0/index.js: Line 32:5 Illegal return statement,https://jslib.k6.io/k6-utils/1.1.0/index.js: Line 34:3 Illegal return statement,https://jslib.k6.io/k6-utils/1.1.0/index.js: Line 37:1 Unexpected end of input,https://jslib.k6.io/k6-utils/1.1.0/index.js: Line 37:1 Unexpected end of input
at reflect.methodValueCall (native)
at file:///home/asinotov/CLionProjects/gws-graph/k6-test/build/app.bundle.js:1:681(65)
at file:///home/asinotov/CLionProjects/gws-graph/k6-test/build/app.bundle.js:1:4125(2) hint="script exception"