I followed the documentation to make Webpack Encore work in my project. Imported js files in webpack.config.js work fine but I have an issue in page-specific js : $ is not
$ is not
You should use output.library: "Root" //Or what name you want config in webpack.config.js and in your entry js file do this:
output.library: "Root" //Or what name you want
import $ from 'jquery' ... Your code of common entry file export {$};
import $ from 'jquery'
... Your code of common entry file
export {$};
And you will access jquery like this:
Root.$