Pls, help me figure it out WebPack Below is all the data for understanding the settings. I tried to implement this functionality in different ways, changed versions, added babel-loader @babel-core and so on... changed to via. Nothing helped, I don't understand why he can't import or export at least one function from WEBPACK, I'm not talking about all the rest of the power of npm. Thank you in advance.
my config
const path = require('path');
module.exports = {
entry: {
site: './src/js/site.js'
},
output: {
filename: '[name].js',
publicPath: '/dist/'
},
mode: "development",
devtool: 'inline-source-map',};
Site.JS
export function Multiply(a, b) {
return a * b;
}
MyJsScript
import { Multiply } from 'site.js'
import Multiply from 'site.js'
Error
Failed to resolve module specifier "site.js". Relative references must start with either "/", "./", or "../".
My Site.js (WebPack creating)
/*! exports provided: Multiply */
/***/
(function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */
__webpack_require__.d(__webpack_exports__, "Multiply", function() {
return Multiply;
});
function Multiply(a, b) {
return a * b;
}
console.log('The \'site\' bundle has been loaded!');
/***/
}
)
/******/ });