Пытаюсь установить jquery через webpack
webpack.config.js
"use strict"
const path = require('path')
const webpack = require('webpack')
module.exports = {
plugins: [
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery"
}),
]
};
pckage.json
{
"name": "mp",
"version": "2.0.0",
"description": "Веб модуль с привязкой жителей к жилым зданиям",
"main": "index.js",
"scripts": {
"dev": "webpack --mode development",
"build": "webpack --mode production",
"watch": "webpack --mode development --watch",
"start": "webpack-dev-server --mode development --open"
},
"repository": {
"type": "git",
"url": "git+https://github.com/AlexandrRumiantsev/app_map.git"
},
"keywords": [
"6Exniskay20"
],
"author": "AlexWeber",
"license": "ISC",
"bugs": {
"url": "https://github.com/AlexandrRumiantsev/app_map/issues"
},
"homepage": "https://github.com/AlexandrRumiantsev/app_map#readme",
"devDependencies": {
"clean-webpack-plugin": "^1.0.0",
"css-loader": "^2.0.0",
"file-loader": "^2.0.0",
"html-webpack-plugin": "^3.2.0",
"image-webpack-loader": "^4.6.0",
"jquery": "^3.4.1",
"mini-css-extract-plugin": "^0.5.0",
"node-sass": "^4.10.0",
"optimize-css-assets-webpack-plugin": "^5.0.1",
"sass-loader": "^7.1.0",
"webpack": "^4.27.1",
"webpack-cli": "^3.1.2"
},
"dependencies": {
"bootstrap": "^4.3.1",
"jquery": "^3.3.1",
"popper.js": "^1.15.0",
"webpack-jquery-ui": "^2.0.1"
}
}
index.js который запускаю через командную строку командой node index.js
(function(){
"use strict";
import $ from 'jquery';
$(document).ready(function($) {
console.log('СЕРВЕР ЗАПУЩЕН');
});
})();
Результат: import $ from 'jquery'; - SyntaxError: Unexpected identifier
ВОПРОС: Что означает ошибка я ЗНАЮ, не могу понять почему?