using Node.js I installed the JSHint package and wrote the following options in the .jshintrc file:
{
"version": 9,
"camelcase": false,
"undef": true,
"unused": false,
"global": {
"window": true
}
}
Next I run build task within gulpfile.js
function lint_client() {
return src('./client/js/Controller_ui.js')
.pipe(jshint())
.pipe(jshint.reporter('default'));
}
function browserify_client() {
return src('./client/js/Controller_ui.js')
.pipe(browserify({
insertGlobals: true
}))
.pipe(rename('Controller_ui.js'))
.pipe(dest('./public'));
}
exports.build = series(lint_client, browserify_client);
Above COntrollef_ui.js file content is:
import $ from 'jquery';
$(window).ready(function(){
console.log('äö');
});
and the message with the problem I have, is in the console:
/workspace/deploy-contracts/client/js/fake_f2c8a270.js:2
import $ from 'jquery';
^
ParseError: 'import' and 'export' may only appear at the top level
or
/workspace/deploy-contracts/client/js/fake_f2c8a270.js:2
import { $ } from 'jquery';
^
ParseError: 'import' and 'export' may only appear at the top level
Is it about the top level of a tree or do I not understand? How to solve or delete the error?